# Adding/removing master eligible nodes to/from existing cluster

**URL:** https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890
**Category:** Elasticsearch
**Created:** [April 27, 2018, 9:07pm UTC](https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890 "2018-04-27T21:07:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![laurentiusoica](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurentiusoica/32/27342_2.png) [@laurentiusoica](https://discuss.elastic.co/u/laurentiusoica)
#### Post date: [April 27, 2018, 9:07pm UTC](https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890/1 "2018-04-27T21:07:10Z")

</div>

Hello,

Considering an existing ES cluster with 3 master eligible nodes, what is the recommended steps to run in order to add 3 new master eligible nodes:

1. add the nodes to the cluster and then
2. update discovery.zen.minimum\_master\_nodes  
or 2, followed by 1?

What about removing 3 master eligible nodes out of 6 ? Is the active master automatically re-elected; is it recommended to move the active master before removing the nodes from the cluster or ES handles it ? Is this a safe order:

1. remove the nodes from the cluster and then
2. update discovery.zen.minimum\_master\_nodes  
or the other way around ?

And what happens with the requests (index/query) during re-election ?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 28, 2018, 12:34am UTC](https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890/2 "2018-04-28T00:34:41Z")

</div>

Do you not have minimum masters set now?

---

<div class="post-metadata">

### Author: ![laurentiusoica](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurentiusoica/32/27342_2.png) [@laurentiusoica](https://discuss.elastic.co/u/laurentiusoica)
#### Post date: [April 28, 2018, 5:20am UTC](https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890/3 "2018-04-28T05:20:42Z")

</div>

Yes, I have, 2. And I assume I need to keep (master\_eligible\_nodes / 2) + 1, right ?

But going to 6 master nodes, a quorum of 2 could potentially generate a split-brain, so I assume that minimum\_master\_nodes must be updated to 4.

And again, going from 6 to 3 nodes, if the minimum\_master\_nodes remains 4, a master election is not possible anymore even if all the master eligible nodes are up.

So basically, my 1st question is what's the right order of operations, if there is one, to scale-in/scale-out, and  
2nd, what happens with the requests (index/query) during re-election

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 30, 2018, 12:40am UTC](https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890/4 "2018-04-30T00:40:49Z")

</div>

The best way would be to add all 3 new masters, then shut down one of the other nodes, set `node.master: false` and restart it, and then do that to the other two master eligible, allowing one of the new masters to take on the role.

---

<div class="post-metadata">

### Author: ![laurentiusoica](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurentiusoica/32/27342_2.png) [@laurentiusoica](https://discuss.elastic.co/u/laurentiusoica)
#### Post date: [April 30, 2018, 8:42am UTC](https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890/5 "2018-04-30T08:42:43Z")

</div>

I have 2 scenarios, basically Scale-in and Scale-out:

1. going from 3 master eligible nodes to 6 master eligible nodes:  
You said "add all 3 new masters". Ok, but this implies 2 steps: adding the master eligible nodes into the cluster and updating the minimum\_master\_nodes in order to avoid split brain situations. Not clear for me in what order should I run these steps.

2. going from 6 master eligible nodes down to 3 master eligible nodes.  
The concern explained for 1 is valid for this scenario as well.  
On top of that, if the current master active is one of the 3 nodes that I plan to remove ,then I'll have to move it , right ? This raised new questions:

- what happens with indexing operations during the master election ? Assuming that I make sure there are no indices created during the re-election, is the cluster able to process index requests?
- how do I handle master re-election ? Is shutting down the node the only option ?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 30, 2018, 11:10pm UTC](https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890/6 "2018-04-30T23:10:46Z")

</div>

Add the nodes first.  
And unless you expect this process to take many hours or days, you can reasonably skip changing minimum masters, just don't waste time after adding the nodes and then updating the configs.

> [@laurentiusoica](#):
>
> what happens with indexing operations during the master election ? Assuming that I make sure there are no indices created during the re-election, is the cluster able to process index requests?  
> how do I handle master re-election ? Is shutting down the node the only option ?

Yes to both.

---

<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: [May 28, 2018, 11:10pm UTC](https://discuss.elastic.co/t/adding-removing-master-eligible-nodes-to-from-existing-cluster/129890/7 "2018-05-28T23:10:49Z")

</div>

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