# Elasticsearch error not enough master nodes discovered during pinging (Although I am able to ping its IP)

**URL:** <https://discuss.elastic.co/t/elasticsearch-error-not-enough-master-nodes-discovered-during-pinging-although-i-am-able-to-ping-its-ip/148065>\
**Category:** Elasticsearch\
**Created:** [September 11, 2018, 6:58am UTC](https://discuss.elastic.co/t/elasticsearch-error-not-enough-master-nodes-discovered-during-pinging-although-i-am-able-to-ping-its-ip/148065 "2018-09-11T06:58:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shashankdesai23](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@shashankdesai23](https://discuss.elastic.co/u/shashankdesai23)\
**Post date:** [September 11, 2018, 6:58am UTC](https://discuss.elastic.co/t/elasticsearch-error-not-enough-master-nodes-discovered-during-pinging-although-i-am-able-to-ping-its-ip/148065/1 "2018-09-11T06:58:56Z")

</div>

I am trying to set up Elastic Search cluster with two nodes but I keep getting this error.

```auto
[o.e.d.z.ZenDiscovery] [master-node] not enough master nodes discovered ?during pinging (found [[Candidate{node={master-node}{EzeNCWZBR0aAKUP6Va9ZwA}{ZFq4O019Q2WVEWiISBQi2g}{ip-172-31-6-165}{172.31.6.165:9300}{ml.machine_memory=8369979392, xpack.installed=true, ml.max_open_jobs=20, 
ml.enabled=true}, clusterStateVersion=-1}]], but needed [2]), pinging again

```

Here are my node configuration

```auto
1. Master Node
    cluster.name: prod-analytic-stats
     node.name: master-node
     path.data: /var/lib/elasticsearch
     path.logs: /var/log/elasticsearch
     network.host: ip-172-31-6-165
     discovery.zen.ping.unicast.hosts: ["ip-172-31-21-37", "ip-172-31-6-165"]
     discovery.zen.minimum_master_nodes: 2

2. data node
     cluster.name: prod-analytic-stats
     node.name: replica-node
     path.data: /var/lib/elasticsearch
     path.logs: /var/log/elasticsearch
     network.host: ip-172-31-21-37
     discovery.zen.ping.unicast.hosts: ["ip-172-31-21-37", "ip-172-31-6-165"]
     discovery.zen.minimum_master_nodes: 1

```

However I am able to ping data node from master node

```auto
root@ip-172-31-6-165:/etc/elasticsearch# ping 172.31.21.37
PING 172.31.21.37 (172.31.21.37) 56(84) bytes of data.
64 bytes from 172.31.21.37: icmp_seq=1 ttl=255 time=1.18 ms
64 bytes from 172.31.21.37: icmp_seq=2 ttl=255 time=1.07 ms
64 bytes from 172.31.21.37: icmp_seq=3 ttl=255 time=1.14 ms
64 bytes from 172.31.21.37: icmp_seq=4 ttl=255 time=1.08 ms
64 bytes from 172.31.21.37: icmp_seq=5 ttl=255 time=1.16 ms
64 bytes from 172.31.21.37: icmp_seq=6 ttl=255 time=1.12 ms
64 bytes from 172.31.21.37: icmp_seq=7 ttl=255 time=1.21 ms
64 bytes from 172.31.21.37: icmp_seq=8 ttl=255 time=1.05 ms
--- 172.31.21.37 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7008ms
rtt min/avg/max/mdev = 1.051/1.131/1.219/0.068 ms

```

I am using Elastic Search 6.3.1 for both the nodes

---

<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:** [September 11, 2018, 7:02am UTC](https://discuss.elastic.co/t/elasticsearch-error-not-enough-master-nodes-discovered-during-pinging-although-i-am-able-to-ping-its-ip/148065/2 "2018-09-11T07:02:08Z")

</div>

Pinging does not mean the ports are accessible. Are you able to telnet to port 9300 on the other host from each host?

If both your nodes are master-eligible, you should also make sure `discovery.zen.minimum_master_nodes` is set to `2` on both nodes.

---

<div class="post-metadata">

**Author:** ![shashankdesai23](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@shashankdesai23](https://discuss.elastic.co/u/shashankdesai23)\
**Post date:** [September 11, 2018, 7:26am UTC](https://discuss.elastic.co/t/elasticsearch-error-not-enough-master-nodes-discovered-during-pinging-although-i-am-able-to-ping-its-ip/148065/3 "2018-09-11T07:26:37Z")

</div>

Yes you are right. I am not able to telnet on port 9300 or 9200.  
I receive following error.

> [root@ip-172-31-21-37 elasticsearch]# telnet ip-172-31-6-165 9300  
> Trying 172.31.6.165...  
> telnet: connect to address 172.31.6.165: Connection timed out

What shall I do to resolve this?

---

<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:** [September 11, 2018, 8:03am UTC](https://discuss.elastic.co/t/elasticsearch-error-not-enough-master-nodes-discovered-during-pinging-although-i-am-able-to-ping-its-ip/148065/4 "2018-09-11T08:03:09Z")

</div>

You probably have some firewall blocking access, so need to address that.

---

<div class="post-metadata">

**Author:** ![shashankdesai23](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@shashankdesai23](https://discuss.elastic.co/u/shashankdesai23)\
**Post date:** [September 11, 2018, 1:06pm UTC](https://discuss.elastic.co/t/elasticsearch-error-not-enough-master-nodes-discovered-during-pinging-although-i-am-able-to-ping-its-ip/148065/5 "2018-09-11T13:06:55Z")

</div>

Yes issue resolved.  
I could not telnet the one host from the other host.  
Which was due to firewall settings that I changed.  
Now its working perfectly.

Thank you

---

<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:** [October 9, 2018, 1:07pm UTC](https://discuss.elastic.co/t/elasticsearch-error-not-enough-master-nodes-discovered-during-pinging-although-i-am-able-to-ping-its-ip/148065/6 "2018-10-09T13:07:08Z")

</div>

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