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?
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.

- 10,234
- 7
- 48
- 75

- 17,031
- 5
- 54
- 48
-
Great explanation Clinton! – javanna Feb 22 '13 at 14:14
-
Thanks for your wonderful answer. Cluster metadata contains something like cluster sate, such as mapping type, shards allocation, right? node metadata contains what? Does it contain some information of indices? – Hoony Feb 24 '13 at 06:07
-
Yes it does. You can see exactly what it contains, by running this request against a node in your cluster: curl -XGET 'http://127.0.0.1:9200/_cluster/state?pretty=1' – DrTech Feb 25 '13 at 13:20
-
Think this answer should be within Elastic documentation, which lack some info specified here – Kamarey Jan 01 '18 at 08:25