# New cluster best practice - discovery.zen.ping.unicast.hosts:

**URL:** <https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964>\
**Category:** Elasticsearch\
**Created:** [June 22, 2019, 5:03pm UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964 "2019-06-22T17:03:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesp220291](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jamesp220291](https://discuss.elastic.co/u/jamesp220291)\
**Post date:** [June 22, 2019, 5:03pm UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/1 "2019-06-22T17:03:33Z")

</div>

Hi

I am building the below cluster

3x dedicated masters  
3x dedicated data nodes  
1x coordinator node

In the setting - discovery.zen.ping.unicast.hosts:

Do I only put the 3x dedicated masters, or shall I put the IP's of all the nodes in the cluster?

This is not really explained what needs to go in here, is it every node in the cluster, or just the masters?

---

<div class="post-metadata">

**Author:** ![proxx](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@proxx](https://discuss.elastic.co/u/proxx)\
**Post date:** [June 22, 2019, 6:06pm UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/2 "2019-06-22T18:06:15Z")

</div>

You need to add the three IP address on each node you have elasticsearch installed. This will make all the three nodes to cluster.

---

<div class="post-metadata">

**Author:** ![jamesp220291](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jamesp220291](https://discuss.elastic.co/u/jamesp220291)\
**Post date:** [June 22, 2019, 6:11pm UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/3 "2019-06-22T18:11:33Z")

</div>

Hi

Elastic search is going to be installed on all 7 Nodes. However only 3 of them are going to be dedicated master.

Are you saying I only need to put the masters IP's in the config for all 7 nodes?

---

<div class="post-metadata">

**Author:** ![proxx](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@proxx](https://discuss.elastic.co/u/proxx)\
**Post date:** [June 22, 2019, 6:44pm UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/4 "2019-06-22T18:44:53Z")

</div>

Yes, including the other 4 nodes since you have Elasticsearch on each of the 7 nodes.

---

<div class="post-metadata">

**Author:** ![jamesp220291](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jamesp220291](https://discuss.elastic.co/u/jamesp220291)\
**Post date:** [June 23, 2019, 6:40pm UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/5 "2019-06-23T18:40:34Z")

</div>

I am slightly confused.

Here - [https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-settings.html)

It says only a list of mater eligible nodes, not all the nodes in your cluster.

Which to me reads as only put the 3 master nodes in the list, but do this for all 7 nodes. Is that correct?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 23, 2019, 9:07pm UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/6 "2019-06-23T21:07:49Z")

</div>

> [@jamesp220291](#):
>
> Is that correct?

Pretty much, yes. Perhaps it helps to think of it this way: every node needs to be able to find the master node when it starts up, and the best way to ensure it can do so is to give the node a list of every master-eligible node, because this list must include the address of the elected master. You can give it more addresses and it'll still work, but it's a bit less efficient as it needs to check a lot more addresses before it finds the master. It's also a pain to keep such a list up-to-date as your cluster grows, and it's unnecessary because master-ineligible nodes are irrelevant to the process of finding the master.

On the master-eligible nodes themselves you technically don't need to include the node's own address in the `discovery.seed_hosts` list, but we generally recommend doing so anyway: it's simpler and less error-prone to have the same list on every node.

---

<div class="post-metadata">

**Author:** ![jamesp220291](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jamesp220291](https://discuss.elastic.co/u/jamesp220291)\
**Post date:** [June 24, 2019, 6:07am UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/7 "2019-06-24T06:07:34Z")

</div>

Hi

Thanks for the clarification.

The other question I had, which is kinda related. is in the Logstash output -

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "logs-%{+YYYY.MM.dd}"  
document\_type =\> "logs"  
}  
stdout { codec =\> rubydebug }  
}

Which elastic node IP do you put in? One of the masters? Or a list of the masters? Is it the same, or different?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 24, 2019, 6:37am UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/8 "2019-06-24T06:37:37Z")

</div>

> [@jamesp220291](#):
>
> Which elastic node IP do you put in? One of the masters? Or a list of the masters? Is it the same, or different?

That setting should be a list of the addresses of the nodes you want to coordinate the indexing of the data coming from Logstash. All nodes have the ability to do this, but generally you want to **avoid** using the master nodes for anything involving actual data like this.

---

<div class="post-metadata">

**Author:** ![jamesp220291](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jamesp220291](https://discuss.elastic.co/u/jamesp220291)\
**Post date:** [June 24, 2019, 6:38am UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/9 "2019-06-24T06:38:57Z")

</div>

Hi,

So, this would be the list of the 3x dedicated data nodes?, for example.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 24, 2019, 6:40am UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/10 "2019-06-24T06:40:08Z")

</div>

That should work, yes.

---

<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:** [July 22, 2019, 6:40am UTC](https://discuss.elastic.co/t/new-cluster-best-practice-discovery-zen-ping-unicast-hosts/186964/11 "2019-07-22T06:40:12Z")

</div>

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