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

**URL:** <https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175>\
**Category:** Elasticsearch\
**Created:** [July 14, 2017, 11:23am UTC](https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175 "2017-07-14T11:23:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hasan\_sharekhan](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hasan\_sharekhan](https://discuss.elastic.co/u/hasan_sharekhan)\
**Post date:** [July 14, 2017, 11:23am UTC](https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175/1 "2017-07-14T11:23:18Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 14, 2017, 11:26am UTC](https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175/2 "2017-07-14T11:26:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hasan\_sharekhan](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hasan\_sharekhan](https://discuss.elastic.co/u/hasan_sharekhan)\
**Post date:** [July 14, 2017, 11:50am UTC](https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175/3 "2017-07-14T11:50:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 14, 2017, 12:00pm UTC](https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175/4 "2017-07-14T12:00:40Z")

</div>

> [@hasan\_sharekhan](#):
>
> 1. what should be the value for discovery.zen.minimum\_master\_nodes to avoid above error.

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.

---

<div class="post-metadata">

**Author:** ![hasan\_sharekhan](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hasan\_sharekhan](https://discuss.elastic.co/u/hasan_sharekhan)\
**Post date:** [July 15, 2017, 6:24am UTC](https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175/5 "2017-07-15T06:24:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 15, 2017, 7:07am UTC](https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175/6 "2017-07-15T07:07:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 12, 2017, 7:07am UTC](https://discuss.elastic.co/t/error-not-enough-master-nodes-discovered-during-pinging-but-needed-2/93175/7 "2017-08-12T07:07:30Z")

</div>

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