# Discovery.zen.ping.unicast.hosts in elasticsearch.yml

**URL:** https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951
**Category:** Elasticsearch
**Created:** [November 8, 2018, 7:44pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951 "2018-11-08T19:44:37Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![vijayakrishna.rg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vijayakrishna.rg/32/36798_2.png) [@vijayakrishna.rg](https://discuss.elastic.co/u/vijayakrishna.rg)
#### Post date: [November 8, 2018, 7:44pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951/1 "2018-11-08T19:44:37Z")

</div>

Hi,

I have totally 4 nodes running under my Azure scaleset, all 4 machines can be talk to each other.

it means pingable each other and telnet using port 22 and 9200 each other.

installed elasticsearch 6.x on all the 4 machines, and also updated elasticsearch.yml with below information on all 4 nodes.

node1

cluster.name: myescluster  
node.name: node1  
network.host: 0.0.0.0  
discovery.zen.ping.unicast.hosts: ["10.0.0.1", "10.0.0.2", "10.0.0.3", "10.0.0.4"]  
node.master: true  
transport.tcp.port: 9300-9400  
http.port: 9200

node2

cluster.name: myescluster  
node.name: node2  
network.host: 0.0.0.0  
discovery.zen.ping.unicast.hosts: ["10.0.0.1", "10.0.0.2", "10.0.0.3", "10.0.0.4"]  
node.master: true  
transport.tcp.port: 9300-9400  
http.port: 9200

node3

cluster.name: myescluster  
node.name: node3  
network.host: 0.0.0.0  
discovery.zen.ping.unicast.hosts: ["10.0.0.1", "10.0.0.2", "10.0.0.3", "10.0.0.4"]  
node.data: true  
transport.tcp.port: 9300-9400  
http.port: 9200

node4

cluster.name: myescluster  
node.name: node4  
network.host: 0.0.0.0  
discovery.zen.ping.unicast.hosts: ["10.0.0.1", "10.0.0.2", "10.0.0.3", "10.0.0.4"]  
node.data: true  
transport.tcp.port: 9300-9400  
http.port: 9200

When i run curl command to list nodes under cluster "curl -XGET [http://localhost:9200/\_cat/nodes?v](http://localhost:9200/_cat/nodes?v)"

it's showing only the self node where am running curl command.

[root@node1 elasticsearch]# curl -XGET [http://localhost:9200/\_cat/nodes?v](http://localhost:9200/_cat/nodes?v)  
ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
10.0.0.1 29 45 1 0.02 0.08 0.11 mdi \* node1

if i run on node2

[root@node2 elasticsearch]# curl -XGET [http://localhost:9200/\_cat/nodes?v](http://localhost:9200/_cat/nodes?v)  
ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
10.0.0.2 29 45 1 0.02 0.08 0.11 mdi \* node2

[root@node3 elasticsearch]# curl -XGET [http://localhost:9200/\_cat/nodes?v](http://localhost:9200/_cat/nodes?v)  
ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
10.0.0.3 29 45 1 0.02 0.08 0.11 mdi \* node3

[root@node4 elasticsearch]# curl -XGET [http://localhost:9200/\_cat/nodes?v](http://localhost:9200/_cat/nodes?v)  
ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
10.0.0.4 29 45 1 0.02 0.08 0.11 mdi \* node4

Cluster health:

[root@node1 elasticsearch]# curl -XGET "[http://localhost:9200/\_cluster/health](http://localhost:9200/_cluster/health)"  
{"cluster\_name":"myescluster","status":"green","timed\_out":false,"number\_of\_nodes":1,"number\_of\_data\_nodes":1,"active\_primary\_shards":0,"active\_shards":0,"relocating\_shards":0,"initializing\_shards":0,"unassigned\_shards":0,"delayed\_unassigned\_shards":0,"number\_of\_pending\_tasks":0,"number\_of\_in\_flight\_fetch":0,"task\_max\_waiting\_in\_queue\_millis":0,"active\_shards\_percent\_as\_number":100.0}

Please suggest if am missing anything, Thanks.

---

<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: [November 8, 2018, 7:47pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951/2 "2018-11-08T19:47:47Z")

</div>

Elasticsearch nodes communicate internally via the 9300 port by default, so you need to make sure this is not blocked.

---

<div class="post-metadata">

### Author: ![vijayakrishna.rg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vijayakrishna.rg/32/36798_2.png) [@vijayakrishna.rg](https://discuss.elastic.co/u/vijayakrishna.rg)
#### Post date: [November 8, 2018, 7:52pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951/3 "2018-11-08T19:52:17Z")

</div>

i can do telnet to other machines using port 9200 and 9300, both are enabled on all 4 machines

---

<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: [November 8, 2018, 7:55pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951/4 "2018-11-08T19:55:56Z")

</div>

One setting I do not see is `discovery.zen.minimum_master_nodes`, which in your case should be set to `3` as you have 4 master-eligible nodes. As the nodes are on different Ids you also do not need to give a port range - `transport.tcp.port: 9300` should do.

---

<div class="post-metadata">

### Author: ![vijayakrishna.rg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vijayakrishna.rg/32/36798_2.png) [@vijayakrishna.rg](https://discuss.elastic.co/u/vijayakrishna.rg)
#### Post date: [November 8, 2018, 8:05pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951/5 "2018-11-08T20:05:19Z")

</div>

Hi Christian, thanks for your quick reply, now i see list of 4 nodes in the cluster.

But final thing is i have added **node.master: true and node.data: false** on node1 and node2 but i see only node2 showing as master in the list, in this case do i need to add **discovery.zen.minimum\_master\_nodes: 2** on all 4 nodes to setup node1 and node2 as master nodes?

curl -XGET [http://localhost:9200/\_cat/nodes?v](http://localhost:9200/_cat/nodes?v)  
ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
10.0.0.3 31 45 0 0.00 0.05 0.07 di - node3  
10.0.0.2 33 45 0 0.05 0.03 0.05 mi \* node2  
10.0.0.1 31 46 1 0.33 0.16 0.10 mi - node1  
10.0.0.4 31 46 0 0.00 0.03 0.05 di - node4

---

<div class="post-metadata">

### Author: ![vijayakrishna.rg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vijayakrishna.rg/32/36798_2.png) [@vijayakrishna.rg](https://discuss.elastic.co/u/vijayakrishna.rg)
#### Post date: [November 8, 2018, 8:54pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951/6 "2018-11-08T20:54:00Z")

</div>

i have added **discovery.zen.minimum\_master\_nodes: 2** on all 4 nodes and restarted service and still see node2 as master and other nodes are data, when i checked cluster health it says total nodes 4 and data nodes 2 what about another node, do i need to update anything in the configuration, please suggest me, Thanks.

curl -XGET "[http://localhost:9200/\_cluster/health](http://localhost:9200/_cluster/health)"  
{"cluster\_name":"myescluster","status":"green","timed\_out":false,"number\_of\_nodes":4,"number\_of\_data\_nodes":2,"active\_primary\_shards":0,"active\_shards":0,"relocating\_shards":0,"initializing\_shards":0,"unassigned\_shards":0,"delayed\_unassigned\_shards":0,"number\_of\_pending\_tasks":0,"number\_of\_in\_flight\_fetch":0,"task\_max\_waiting\_in\_queue\_millis":0,"active\_shards\_percent\_as\_number":100.0}

---

<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: [November 8, 2018, 9:02pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951/7 "2018-11-08T21:02:07Z")

</div>

You should always aim to have at least 3 master-eligible nodes in the cluster. 2 is not a good number. Only one will be acting as master at any time.

---

<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: [December 6, 2018, 9:02pm UTC](https://discuss.elastic.co/t/discovery-zen-ping-unicast-hosts-in-elasticsearch-yml/155951/8 "2018-12-06T21:02:08Z")

</div>

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