# Removing master node permanently

**URL:** <https://discuss.elastic.co/t/removing-master-node-permanently/350002>\
**Category:** Elasticsearch\
**Created:** [December 27, 2023, 6:16am UTC](https://discuss.elastic.co/t/removing-master-node-permanently/350002 "2023-12-27T06:16:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![artechkey](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@artechkey](https://discuss.elastic.co/u/artechkey)\
**Post date:** [December 27, 2023, 6:16am UTC](https://discuss.elastic.co/t/removing-master-node-permanently/350002/1 "2023-12-27T06:16:02Z")

</div>

Hi,  
We currently have a 2 node + master-voting only node cluster. We are expanding the cluster by adding 3 more nodes to it. As part of the expansion, we want to designate one of the new nodes as a master and take out the master-voting-only node from the cluster.

Current config: 2 nodes (all roles) + 1 master-voting-only node  
Desired config: 3 nodes (all roles) + 2 nodes (all roles except master)

From the docs, it looks like we can remove the master-voting-only node by just shutting it down. But will the cluster continue to remember this node? After removing it and adding the new nodes, there will continue to be 3 master nodes. Will these 3 form the new ensemble and any 2 of these would be sufficient for quorum in the future?

Also, is there a way to allocate all roles except "master" to a node other than explicitly specifying all the roles in the yml file?

Thanks,  
AR.

---

<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:** [December 27, 2023, 6:24am UTC](https://discuss.elastic.co/t/removing-master-node-permanently/350002/2 "2023-12-27T06:24:54Z")

</div>

> [@artechkey](#):
>
> After removing it and adding the new nodes, there will continue to be 3 master nodes.

Yes, see [these docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-voting.html):

> After a node joins or leaves the cluster, Elasticsearch reacts by automatically making corresponding changes to the voting configuration in order to ensure that the cluster is as resilient as possible.

> [@artechkey](#):
>
> Also, is there a way to allocate all roles except "master" to a node other than explicitly specifying all the roles in the yml file?

No, see [these docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#node-roles):

> You define a node’s roles by setting `node.roles` in `elasticsearch.yml` . If you set `node.roles` , the node is only assigned the roles you specify. If you don’t set `node.roles` , the node is assigned the following roles:

---

<div class="post-metadata">

**Author:** ![artechkey](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@artechkey](https://discuss.elastic.co/u/artechkey)\
**Post date:** [December 27, 2023, 8:18am UTC](https://discuss.elastic.co/t/removing-master-node-permanently/350002/3 "2023-12-27T08:18:31Z")

</div>

Thank you David.

> After a node joins or leaves the cluster, Elasticsearch reacts by automatically making corresponding changes to the voting configuration in order to ensure that the cluster is as resilient as possible.

This is my understanding as well. But the docs also state the below:

> Also, there are situations where the most resilient configuration includes unavailable nodes or does not include some available nodes. In these situations, the voting configuration differs from the set of available master-eligible nodes in the cluster. In these situations, the voting configuration differs from the set of available master-eligible nodes in the cluster.

Assuming that `cluster.auto_shrink_voting_configuration` is set to `true`, then the above situation where the voting configuration contains unavailable nodes should never arise. Is this understanding correct?

Thanks,  
AR.

---

<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:** [December 27, 2023, 10:01am UTC](https://discuss.elastic.co/t/removing-master-node-permanently/350002/4 "2023-12-27T10:01:01Z")

</div>

> [@artechkey](#):
>
> the above situation where the voting configuration contains unavailable nodes should never arise

"never" is a little strong, it might exist as a transient situation, but ES will automatically fix things up as soon as it can

---

<div class="post-metadata">

**Author:** ![artechkey](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@artechkey](https://discuss.elastic.co/u/artechkey)\
**Post date:** [December 27, 2023, 2:31pm UTC](https://discuss.elastic.co/t/removing-master-node-permanently/350002/5 "2023-12-27T14:31:14Z")

</div>

Hi David,  
Thank you for the confirmation.  
By "never", I meant the same thing - that ES will "eventually" remove any unavailable master nodes from the voting configuration if the node is shut down as long as the property `cluster.auto_shrink_voting_configuration` is set to `true`.

Thanks,  
AR.

---

<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:** [January 24, 2024, 2:31pm UTC](https://discuss.elastic.co/t/removing-master-node-permanently/350002/6 "2024-01-24T14:31:44Z")

</div>

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