Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Es cluster master node configuration combination

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

In the production environment, if the role information of the elasticsearch node is not modified, the cluster is prone to brain cleft and other problems in the scenario of high data volume and high concurrency.

By default, each node in the elasticsearch cluster is eligible to be a master, stores data, and provides query services. These functions are controlled by two properties.

1. Node.master 2. node.data the value of both properties is true by default. Node.master:

This attribute indicates whether the node is eligible to be the master. Note: the value of this attribute is true, which does not mean that the node is the master. Because the real master node is elected by multiple nodes with the qualification of the master node. Therefore, this attribute only represents whether the node is eligible for primary node election.

Node.data:

This attribute indicates whether the node stores data.

Five combinations 1. Node.master: true node.data: true node.ingest: true

This combination means that the node not only has the qualification to be the master node, but also can store data, and can also be used as a preprocessing node. At this time, if a node is elected as the real master node, it also has to store data. This puts more pressure on this node.

Elasticsearch defaults to: every node is configured like this, and it's okay to do so in a test environment. In practice, it is not recommended to set this up, which is equivalent to the mixing of the roles of the master node and the data node.

Combination 2. Node.master: false node.data: true node.ingest: false

This combination means that the node is not qualified to be the master node, so it will not participate in the election, but will only store data. This node is called the data (data) node. Several such nodes need to be set up separately in the cluster to store data. Provide storage and query services at a later stage

Combination 3. Node.master: true node.data: false node.ingest: false

This combination means that the node will not store data, is qualified to be the master, can participate in the election, and may become the real master. This node is called the master node.

Combination 4. Node.master: false node.data: false node.ingest: true

This combination means that this node will not become a master node, nor will it store data. The meaning of this node is that it can be used as a client (client) node, mainly for load balancing for massive requests. After the new version of ElasticSearch6.x, the node is called coordinate node, and an ingest node is added to preprocess data (both indexing and search phases can be used). Of course, as a general application, there is no need for this preprocessing node to do any additional preprocessing, so this node and what we call client node can be regarded as equivalent. We can configure these ingest nodes by configuring the access nodes in the code.

Combination 5. Node.master: false node.data: false node.ingest: false

This configuration is pure query mode, and nodes can only accept queries. For clusters with a large amount of query data, configuring this kind of nodes can effectively protect data nodes and prevent datanode memory overflow. This mode is more resource-saving than mode 4, and it is a pure query mode!

Summary

By default, each node is eligible to be a master, stores data, and processes client requests. We can divide the responsibilities of these nodes in a production cluster.

It is recommended to set more than 3 nodes in the cluster as master nodes [node.master: true node.data: false node.ingest:false]. These nodes are only responsible for becoming master nodes and maintaining the state of the entire cluster.

Then set up a batch of data nodes [node.master: false node.data: true node.ingest:false] according to the amount of data, these nodes are only responsible for storing data, and later provide indexing and query services, so that if users request more frequently, the pressure on these nodes will be greater.

Therefore, it is recommended to set up another batch of ingest nodes in the cluster, also known as client nodes.

[

Node.master: false

Node.data: false

Node.ingest:true

]

Or

[

Node.master: false

Node.data: false

Node.ingest:false

]

These nodes are only responsible for processing user requests, realizing request forwarding, load balancing and other functions.

Master node: ordinary server is fine (CPU memory consumption is average)

Data node: mainly consumes disk and memory

Client | ingest node: ordinary server is fine (if you want to perform grouping aggregation operation, it is recommended that this node allocate more memory)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report