Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What different between Master node gateway and other node gateway in elasticsearch? Both of them store meta data, isn't it?

What different between Master node gateway and other node gateway in elasticsearch? Both of them store meta data, isn't it? Meta data, elasticsearch called, what information we can get from it?

like image 373
Hoony Avatar asked Feb 22 '13 08:02

Hoony


People also ask

What are the main differences between master and data nodes?

Each node is assigned one or more roles, which describe the node's responsibility and operations. Data nodes store the data, and participate in the cluster's indexing and search capabilities, while master nodes are responsible for managing the cluster's activities and storing the cluster state, including the metadata.

What is the role of master node in Elasticsearch?

The master node is responsible for lightweight cluster-wide actions such as creating or deleting an index, tracking which nodes are part of the cluster, and deciding which shards to allocate to which nodes. It is important for cluster health to have a stable master node.

How many master nodes should I have Elasticsearch?

However, for any other use, you need at least a minimum of 3 master nodes in order to avoid any split-brain situation. This is a terrible situation to be in; it can result in an unhealthy cluster with many issues. This setting should always be configured to a quorum (majority) of your master-eligible nodes.


1 Answers

The master node is the same as any other node in the cluster, except that it has been elected to be the master.

It is responsible for coordinating any cluster-wide changes, such as the addition or removal of a node, creation, deletion or change of state (i.e. open/close) of an index, and the allocation of shards to nodes. When any of these changes occur, the "cluster state" is updated by the master and published to all other nodes in the cluster. It is the only node that may publish a new cluster state.

The tasks that a master performs are lightweight. Any tasks that deal with data (eg indexing, searching etc) do not need to involve the master. If you choose to run the master as a non-data node (ie a node that acts as master and as a router, but doesn't contain any data) then the master can run happily on a smallish box.

A node is allowed to become a master if it is marked as "master eligible" (which all nodes are by default). If the current master goes down, a new master will be elected by the cluster.

An important configuration option in your cluster is minimum_master_nodes. This specifies the number of "master eligible" nodes that a node must be able to see in order to be part of a cluster. Its purpose is to avoid "split brain" ie having the cluster separate into two clusters, both of which think that they are functioning correctly.

For instance, if you have 3 nodes, all of which are master eligible, and set minimum_master_nodes to 1, then if the third node is separated from the other two it, it still sees one master-eligible node (itself) and thinks that it can form a cluster by itself.

Instead, set minimum_master_nodes to 2 in this case (number of nodes / 2 + 1), then if the third node separates, it won't see enough master nodes, and thus won't form a cluster by itself. It will keep trying to join the original cluster.

While Elasticsearch tries very hard to choose the correct defaults, minimum_master_nodes is impossible to guess, as it has no way of knowing how many nodes you intend to run. This is something you must configure yourself.

like image 77
DrTech Avatar answered Sep 21 '22 15:09

DrTech