In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what is the Elasticsearch election mechanism". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations. I hope you can read carefully and learn something!
ES Cluster Composition
ES cluster is composed of nodes. Node types can be configured as follows:
conf/elasticsearch.yml: node.master: true/false node.data: true/false
node.master: true --candidate node for master, can participate in elections, often referred to as master-eligible node in ES documentation
node.data: true --Data node that stores data for shards assigned to the node and is responsible for writing, querying, etc. of those shards.
Any node in a cluster can execute any request, and it is responsible for forwarding the request to the corresponding node for processing, so when node.master and node.data are both false, this node can act as a proxy-like node, accepting requests and forwarding, aggregating results, etc.
node discovery
ZenDiscovery is a set of modules implemented by ES itself for node discovery and master selection, without relying on Zookeeper and other tools.
In short, node discovery depends on the following configuration:
conf/elasticsearch.yml: discovery.zen.ping.unicast.hosts: [1.1.1.1, 1.1.1.2, 1.1.1.3]
This configuration can be seen as establishing an edge from this node to each node in the hosts. When all nodes in the whole cluster form a connectivity graph, all nodes can know which nodes are in the cluster and will not form islands. This is the official recommendation for all master-eligible nodes.
Master Election
As mentioned above, there may be multiple master candidate nodes in the cluster, and in this case, master election is required to ensure that only one is elected as master. If more than one node is elected as master, the cluster will have a brain split, which will destroy the consistency of the data, resulting in uncontrollable cluster behavior and various unexpected effects.
In order to avoid brain splitting, ES adopts the common distributed system idea, ensuring that the elected master is recognized by the candidate nodes of the majority (quorum), so as to ensure that there is only one master. This quorum is configured with the following configuration:
conf/elasticsearch.yml: discovery.zen.minimum_master_nodes: 2"Elasticsearch election mechanism is what" content introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.