[Source code analysis] The startup process of elastic search 8.0.0 (3)

This article continues to introduce the content involved in the elastic search startup process and its own analysis

1. Create SearchModule

Modules related to query, aggregation, suggesters. The creation of this module means to register some built-in term, phrase and other query methods in es itself and the query-related rules provided in the plugin to es.

Built-in highlighting rules and the highlighting rules provided in the plugin

Some built-in scoring rules and highlighting rules provided in the plugin

The built-in parse method plugin for query bodies, such as the common WildcardQuery, TermQuery, BoolQuery, etc.

Built-in sorting rules, such as sorting by field, sorting by geographic distance, and sorting by score

Built-in some rules related to heuristic search

Some built-in aggregators, such as maximum, minimum, average, sum, etc.

Built-in sub-phase analysis, because the query phase is actually divided into two major phases fetch and query by es, and the sub-phase referred to here refers to the sub-phase FetchSubPhase in the fetch phase

The built-in shape search is some concepts related to geospatial

Some rules for the built-in interval query

2. CircuitBreakerService related to fuse service

In order to play a protective role when loading field data, the default execution method is HierarchyCircuitBreakerService,

For those operations or functions that will be protected by fuse, there are 5 types, which can also be understood as restrictions. After reaching the built-in bottleneck of es, it will be fuse.

What are the specific contents, let's give a few examples

This is one of the request types

 public static final Setting<ByteSizeValue> REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING =
        Setting.memorySizeSetting("indices.breaker.request.limit", "60%", Property.Dynamic, Property.NodeScope);

These fusing thresholds are not for a single index, but for a single node in the cluster.

3、GatewayModule

The role of this class has nothing to do with the gateway, at least it has nothing to do with the gateway in the microservice.

DanglingIndicesState is a part of it. DanglingIndices refers to when a node wants to join a cluster, but the data in this node does not exist in the cluster, then we need to import the data, mainly to solve the problem of data loss. The ultimate goal is to import the data in node into the cluster. As for why the data did not exist before, it is not its main concern.

Another part is the local gateway, which means that it will store the state of the cluster and share data for the nodes in the entire cluster when the cluster is restarted.

4 、 IndexStorePlugin

When each shard is stored, a new folder must be created

When each shard is stored, a new recovery state must be created to prepare for the recovery of the shard

5. Create a system index

9 types in total

It turns out that these indexes belong to the built-in indexes of the system, and only work when es is used in conjunction with the corresponding middle price.

6、BatchedRerouteService

Reroute the request request. There are many reasons for the cluster status to change. The main application scenario of BatchedRerouteService is that the master node is re-elected

To be continued

Guess you like

Origin blog.csdn.net/weixin_39394909/article/details/108426133