# Cluster discovery configuration

**URL:** <https://discuss.elastic.co/t/cluster-discovery-configuration/204525>\
**Category:** Elasticsearch\
**Created:** [October 21, 2019, 4:40pm UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525 "2019-10-21T16:40:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pinakinab](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pinakinab](https://discuss.elastic.co/u/pinakinab)\
**Post date:** [October 21, 2019, 4:40pm UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525/1 "2019-10-21T16:40:18Z")

</div>

We are trying to host an elasticsearch cluster with **3 Master Nodes** and **6 Data Nodes**. In order to establish a cluster, we are providing **discovery.seed\_hosts** and **cluster.initial\_master\_nodes** in the elasticsearch.yml file.

In **discovery.seed\_hosts** , we are currently providing hostnames for all the nodes (master as well as data).

In **cluster.initial\_master\_nodes** , we are currently providing node.name info for all the master nodes.

The question here is, do we really need to include data nodes in the **discovery.seed\_hosts**? or is it okay if we just specify only **master nodes**?

---

<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:** [October 21, 2019, 5:15pm UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525/2 "2019-10-21T17:15:59Z")

</div>

> [@pinakinab](#):
>
> The question here is, do we really need to include data nodes in the **discovery.seed\_hosts**? or is it okay if we just specify only **master nodes**?

You should only refer to the master nodes in `discovery.seed_hosts`. From [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/discovery-settings.html#unicast.hosts):

> ... you must use the `discovery.seed_hosts` setting to provide a list of other nodes in the cluster that are master-eligible [...] This setting should normally contain the addresses of all the master-eligible nodes in the cluster.

---

<div class="post-metadata">

**Author:** ![pinakinab](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pinakinab](https://discuss.elastic.co/u/pinakinab)\
**Post date:** [October 22, 2019, 6:57pm UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525/3 "2019-10-22T18:57:58Z")

</div>

@DavidTurner - So is there any configuration parameter where in we need to specify list of hostnames of data nodes?

---

<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:** [October 22, 2019, 7:11pm UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525/4 "2019-10-22T19:11:08Z")

</div>

No, there is no such parameter.

---

<div class="post-metadata">

**Author:** ![pinakinab](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pinakinab](https://discuss.elastic.co/u/pinakinab)\
**Post date:** [October 23, 2019, 6:07am UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525/5 "2019-10-23T06:07:31Z")

</div>

@DavidTurner - Thanks! That helps a lot.

---

<div class="post-metadata">

**Author:** ![ted.fed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ted.fed/32/56636_2.png) [@ted.fed](https://discuss.elastic.co/u/ted.fed)\
**Post date:** [October 25, 2019, 4:36pm UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525/6 "2019-10-25T16:36:59Z")

</div>

@DavidTurner, it is a bit confusing then. There seems to be very less difference between **discovery.seed\_hosts** and **cluster.initial\_master\_nodes**.  
For production mode:

1. seed\_hosts should contain the hostnames or the IPs of all master eligible nodes and
2. initial\_master\_nodes should contain the node.names of all master eligible nodes.

Is that a correct understanding?  
And if yes, then why can't one be derived from the other automatically by ES since the mapping is already known to ES?

Thinking aloud, the property names like **cluster.master\_hostnames** and **cluster.master\_names** might be more clear perhaps.

---

<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:** [October 25, 2019, 6:07pm UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525/7 "2019-10-25T18:07:43Z")

</div>

There's a superficial similarity but they're really very different settings.

`discovery.seed_hosts` is about discovery, i.e. finding the master nodes, so belongs in the `discovery.*` settings namespace. It must be set on every node whether master-eligible or not because every node must perform discovery. It should be kept up to date as the cluster evolves, but it tolerates mistakes (particularly extra nodes) and need not be precisely synchronised across all nodes. It can involve an external service (e.g. DNS) which may not give wholly consistent answers, and is just one of a number of pluggable mechanisms for discovering the master nodes in a cluster.

`cluster.initial_master_nodes` is about cluster bootstrapping, i.e. the first election in the cluster, so belongs in the `cluster.*` settings namespace. It need not be set on master-ineligible nodes because these nodes do not take part in the first election. It absolutely must not be adjusted as the cluster evolves and can be removed once the first election has taken place. It does not tolerate mistakes and must be precisely synchronised across all nodes on which it is set. It must not involve external services like DNS for consistency reasons, and it cannot be supplied by a plugin.

The mapping between master names and addresses is not "already known" to ES and cannot be automatically discovered. A node may ask another node for its name but only once it knows its address, but addresses do not uniquely and consistently identify nodes.

---

<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:** [November 22, 2019, 6:07pm UTC](https://discuss.elastic.co/t/cluster-discovery-configuration/204525/8 "2019-11-22T18:07:46Z")

</div>

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