Error: Not enough master nodes discovered during pinging but needed 2

Error: Not enough master nodes discovered during pinging but needed 2

I have created 3 nodes in same cluster and same machine with below setting for all nodes.

node.master: true
node.data: true
node.ingest: true
discovery.zen.minimum_master_nodes: 2

when i start 1st node i gets this error "Not enough master nodes discovered during pinging" and it never goes in to READY state.

Calling http://localhost:9200/_cat/indices?v in browser is returning

{
    "error": {
        "root_cause": [
            {
                "type": "master_not_discovered_exception",
                "reason": null
            }
        ],
        "type": "master_not_discovered_exception",
        "reason": null
    },
    "status": 503
}

After starting 2nd node then 1st nodes changes its state to READY, and 2nd node also starts normally.

I am expecting even if 1 node is up it is should in READY state

With the settings you have in place, 2 master eligible nodes need to be available in the cluster in order for one of them to be elected master and the cluster to operate properly. If you only have one node started, what you are seeing is expected and correct, as this prevents a single node that gets partitioned off from the rest of the cluster, e.g. due to a network problem, to continue accepting data that could get lost..

1 Like

Thanks for reply, i have few queries.

  1. what should be the value for discovery.zen.minimum_master_nodes to avoid above error.

  2. I want to configure ES clusters to avoid downtime and also to avoid split brain situations. If possible please suggest good cluster setup like how many minimum nodes and what should be there roles like

node.master: ?
node.data: ?
node.ingest: ?

This is not an error if you only have one node started. It is the correct behaviour.

The setting you have is correct in order to avoid split-brain scenarios and allow the cluster to be highly available. It does however require 2 nodes to be present.

1 Like

Thanks, so in my case minimum 2 nodes are needed to be up if I have 3 nodes

What if I have more nodes like 9 then I need to have minimum 5 nodes up for ElasticSearch to run properly.

If all nodes are master-eligible that would be the case. For larger clusters it is however common to have 3 dedicated master nodes, and of these 2 need to be available at all times. If you want to be able to lose any 2 nodes and still operate, you could have 5 master eligible nodes instead.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.