Elasticsearch Master Node Not Discovered



Elasticsearch Master Node Not Discovered

Opster Team

July 2020, Version: 1.7-8.0


Before you begin reading the explanation below, try running the free ES Health Check-Up get actionable recommendations that can improve Elasticsearch performance and prevent serious incidents. Just 2 minutes to complete and you can check your threadpools, memory, snapshots and many more

What Does it Mean?

An Elasticsearch cluster requires a master node to be identified in the cluster in order for it to start properly. Furthermore, the election of the master node requires that there be a quorum of 50% and one of the nodes must have voting rights. If the cluster lacks a quorum, it will not start. For further information please see this guide on the split-brain problem.

Possible Causes

Incorrect Discovery Settings

If you are getting this warning in the logs:

Master node not discovered yet this node has not previously joined a bootstrapped cluster

Then the most likely explanation is that you have incorrect settings in elasticsearch.yml, which prevent the node correctly discovering its peer nodes.

discovery.seed_hosts:
   - 192.168.1.1:9300
   - 192.168.1.2 
   - nodes.mycluster.com

The discovery seed hosts should contain a list of nodes in the cluster (of which at least one must be available the first time the node joins the cluster) in order for the discovery function to work).

If it is the first time the cluster has started, then the following setting is also important:

cluster.initial_master_nodes:
  - master-node-name1
  - master-node-name2
  - master-node-name3

Note that here the settings are the node names (not IP addresses) of eligible master nodes that have the setting:

node.master: true 

Master Not Elected

If you see the message:

master not discovered or elected yet, an election requires at least 2 nodes with ids from [UIDIdndidisz99dkhslihn, xkenktjsiasnKKKhdb s, YZ6m2ioDQWqi1cNnOteB6w]

This suggests that a number of master nodes previously existed in the cluster, but insufficient master nodes are now available.  The likely cause is that master nodes have been removed from the cluster and so a quorum has not been reached to elect a new master node.  If you have recently stopped master nodes, then you will need to add them back, or wait for Elasticsearch to adjust the quorum down to the actual number of master nodes available.

See https://opster.com/elasticsearch-glossary/minimum-master-node-higher-than/ for more information on this.

Node Stability Issues

If the nodes are under stress due to heavy indexing or searching, then this can cause them to become unavailable, which in turn can affect the capacity of the cluster to elect a new master. This is the main reason for using a dedicated master node. Learn more here: https://opster.com/elasticsearch-glossary/dedicated-master-node/ 



About Opster

Opster detects, prevents, optimizes and automates everything needed to run mission-critical Elasticsearch

Find Configuration Errors

Analyze Now