# ES7: Do we need cluster.initial\_master\_nodes when a node restarts?

**URL:** <https://discuss.elastic.co/t/es7-do-we-need-cluster-initial-master-nodes-when-a-node-restarts/221320>\
**Category:** Elasticsearch\
**Created:** [February 27, 2020, 8:01pm UTC](https://discuss.elastic.co/t/es7-do-we-need-cluster-initial-master-nodes-when-a-node-restarts/221320 "2020-02-27T20:01:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![UDixit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/udixit/32/53219_2.png) [@UDixit](https://discuss.elastic.co/u/UDixit)\
**Post date:** [February 27, 2020, 8:01pm UTC](https://discuss.elastic.co/t/es7-do-we-need-cluster-initial-master-nodes-when-a-node-restarts/221320/1 "2020-02-27T20:01:07Z")

</div>

As per the documents, we need `Cluster.initial_master_nodes` only for the first bootstrap of the cluster.

1. How does a node join the cluster when it restarts? Does it only need the sed\_hosts to discover others?
2. What if the entire cluster went down? will the nodes use the `initial_master_node` setting?
3. Since in most cases, we gradually add nodes to the cluster the `initial_master_nodes` setting should always be the very first node that started. In what scenarios will you add 2 or more nodes names to this setting?

---

<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:** [February 27, 2020, 8:08pm UTC](https://discuss.elastic.co/t/es7-do-we-need-cluster-initial-master-nodes-when-a-node-restarts/221320/2 "2020-02-27T20:08:20Z")

</div>

> [@UDixit](#):
>
> How does a node join the cluster when it restarts? Does it only need the seed\_hosts to discover others?

Yes, that's right.

> [@UDixit](#):
>
> What if the entire cluster went down? will the nodes use the `initial_master_node` setting?

No, it's only used the very first time the cluster starts.

> [@UDixit](#):
>
> In what scenarios will you add 2 or more nodes names to this setting?

It's ok to start your nodes one-at-a-time if you want, but it's not unusual to start up all the nodes at once to make sure that it's fault-tolerant right from the start.

---

<div class="post-metadata">

**Author:** ![UDixit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/udixit/32/53219_2.png) [@UDixit](https://discuss.elastic.co/u/UDixit)\
**Post date:** [February 27, 2020, 8:13pm UTC](https://discuss.elastic.co/t/es7-do-we-need-cluster-initial-master-nodes-when-a-node-restarts/221320/3 "2020-02-27T20:13:00Z")

</div>

Thanks for the prompt reply. Really appreciated.

So there is no harm in populating the `cluster.initial_master_nodes` repeatedly.  
It should simply get ignored

---

<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:** [February 27, 2020, 8:32pm UTC](https://discuss.elastic.co/t/es7-do-we-need-cluster-initial-master-nodes-when-a-node-restarts/221320/4 "2020-02-27T20:32:15Z")

</div>

> [@UDixit](#):
>
> So there is no harm in populating the `cluster.initial_master_nodes` repeatedly.  
> It should simply get ignored

It's safest to remove it as soon as possible after the cluster has started up for the first time, which is what the [docs recommend](https://www.elastic.co/guide/en/elasticsearch/reference/current/discovery-settings.html#initial_master_nodes):

> You should not use this setting when restarting a cluster or adding a new node to an existing cluster.

It's _mostly_ ok to leave it in place, but that does open the door to some (really rare) failure scenarios that can result in data loss.

---

<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:** [March 26, 2020, 8:32pm UTC](https://discuss.elastic.co/t/es7-do-we-need-cluster-initial-master-nodes-when-a-node-restarts/221320/5 "2020-03-26T20:32:29Z")

</div>

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