# Elasticsearch master node election

**URL:** https://discuss.elastic.co/t/elasticsearch-master-node-election/218700
**Category:** Elasticsearch
**Created:** [February 11, 2020, 2:22am UTC](https://discuss.elastic.co/t/elasticsearch-master-node-election/218700 "2020-02-11T02:22:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Javier\_Meza\_Cogollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javier_meza_cogollo/32/62412_2.png) [@Javier\_Meza\_Cogollo](https://discuss.elastic.co/u/Javier_Meza_Cogollo)
#### Post date: [February 11, 2020, 2:22am UTC](https://discuss.elastic.co/t/elasticsearch-master-node-election/218700/1 "2020-02-11T02:22:34Z")

</div>

Hi everyone!

I was working with the version 6.4 of elasticsearch, I always have had two nodes, in that version when the node A got down, the node B automatically took the master role.

I just upgrade to the 7.5.2 version, I would like to know whether in this version the master node selection only occurs one time (in the very beginning of the cluster). when I turn off my master node, it seems like the other one is not able to give any information about the cluster (HEALTH, NODES), but it works.

Can somebody explain it to me, how the master node selection works in version 7.5.2?

---

<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: [February 11, 2020, 2:35am UTC](https://discuss.elastic.co/t/elasticsearch-master-node-election/218700/2 "2020-02-11T02:35:54Z")

</div>

The behaviour you describe in version 6.4 indicates that your cluster is incorrectly configured and does not have minimum\_master\_nodes set to 2 as it should if you have 2 master eligible nodes in the cluster. See [the docs for more information](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/modules-node.html#split-brain).

In order to create a cluster that can handle the loss of a master eligible node and still be available you require a minimum of 3 master eligible nodes in the cluster. 2 nodes is not sufficient as a strict majority of master eligible nodes is required and the majority of 2 is 2.

Version 7 has improved protection against this type of misconfiguration which can lead to split brain scenarios and data loss and enforces the correct behaviour.

---

<div class="post-metadata">

### Author: ![Javier\_Meza\_Cogollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javier_meza_cogollo/32/62412_2.png) [@Javier\_Meza\_Cogollo](https://discuss.elastic.co/u/Javier_Meza_Cogollo)
#### Post date: [February 11, 2020, 1:53pm UTC](https://discuss.elastic.co/t/elasticsearch-master-node-election/218700/3 "2020-02-11T13:53:10Z")

</div>

Hey Christian! thanks in advance for your response.

So, if I want to have another master node available if the current is down, what I have to do is basically create a new master-elegible node and specify it in the `cluster.initial_master_nodes`.

That is clear, but I have the last question, Do I need to add this config in all my master-elegible nodes?  
EG:

master-a  
cluster.initial\_master\_nodes:["master-a", "master-b", "master-c"]

* * *

master-b  
cluster.initial\_master\_nodes:["master-a", "master-b", "master-c"]

* * *

master-c  
cluster.initial\_master\_nodes:["master-a", "master-b", "master-c"]

---

<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 11, 2020, 3:02pm UTC](https://discuss.elastic.co/t/elasticsearch-master-node-election/218700/4 "2020-02-11T15:02:53Z")

</div>

> [@Javier\_Meza\_Cogollo](#):
>
> So, if I want to have another master node available if the current is down

This is not possible. When a new node starts up it has to get the current state of the cluster from another master node that's currently running.

> [@Javier\_Meza\_Cogollo](#):
>
> `cluster.initial_master_nodes`

This setting is ignored once the cluster has started up for the first time. You should never change it, but you can safely delete it once the cluster has started up.

---

<div class="post-metadata">

### Author: ![Javier\_Meza\_Cogollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javier_meza_cogollo/32/62412_2.png) [@Javier\_Meza\_Cogollo](https://discuss.elastic.co/u/Javier_Meza_Cogollo)
#### Post date: [February 11, 2020, 3:39pm UTC](https://discuss.elastic.co/t/elasticsearch-master-node-election/218700/5 "2020-02-11T15:39:20Z")

</div>

Thank you! I got it.

---

<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 10, 2020, 3:39pm UTC](https://discuss.elastic.co/t/elasticsearch-master-node-election/218700/6 "2020-03-10T15:39:23Z")

</div>

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