# How to remove master nodes from the elasticsearch cluster

**URL:** <https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [November 8, 2023, 5:39pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732 "2023-11-08T17:39:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![efrainMZ](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@efrainMZ](https://discuss.elastic.co/u/efrainMZ)\
**Post date:** [November 8, 2023, 5:39pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/1 "2023-11-08T17:39:46Z")

</div>

How could I delete two master nodes that are in my cluster, I currently have 3 master nodes, the cluster version is 7.17.

thank you

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 8, 2023, 5:55pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/2 "2023-11-08T17:55:13Z")

</div>

You need to have at least 2 eligible master nodes + 1 master node in the cluster.

Once you have that, you can just stop the master only nodes, one by one.

---

<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:** [November 8, 2023, 6:09pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/3 "2023-11-08T18:09:38Z")

</div>

You can scale-down the master nodes to 1 if you want, although it's definitely better to have 3 in many cases. The manual describes how:

> **[Add and remove nodes in your cluster | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/add-elasticsearch-nodes.html#modules-discovery-removing-nodes)**

---

<div class="post-metadata">

**Author:** ![efrainMZ](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@efrainMZ](https://discuss.elastic.co/u/efrainMZ)\
**Post date:** [November 9, 2023, 5:11pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/4 "2023-11-09T17:11:16Z")

</div>

Hello good morning DavidTurner!

I followed the documentation you recommended and it was successful! I was able to remove the master nodes and only keep one in the cluster.

---

<div class="post-metadata">

**Author:** ![efrainMZ](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@efrainMZ](https://discuss.elastic.co/u/efrainMZ)\
**Post date:** [November 9, 2023, 5:12pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/5 "2023-11-09T17:12:36Z")

</div>

I did it like this and it worked wonderfully.  
Thank you dadoonet!

---

<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:** [November 9, 2023, 5:34pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/6 "2023-11-09T17:34:02Z")

</div>

> [@efrainMZ](#):
>
> I followed the documentation you recommended and it was successful! I was able to remove the master nodes and only keep one in the cluster.

Why are you reducing to only 1 master eligible node? Are you moving to a single-node cluster?

---

<div class="post-metadata">

**Author:** ![efrainMZ](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@efrainMZ](https://discuss.elastic.co/u/efrainMZ)\
**Post date:** [November 10, 2023, 3:50pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/7 "2023-11-10T15:50:53Z")

</div>

Hi Christian  
My idea is to temporarily have a cluster on a single node, then upgrade the other nodes to version 8.10 and then migrate the data from the old cluster to the new one.

---

<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:** [November 11, 2023, 6:20pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/8 "2023-11-11T18:20:36Z")

</div>

That seems like an unnecessarily complicated approach. Why not just do a normal [rolling upgrade](https://www.elastic.co/guide/en/elastic-stack/8.11/upgrading-elasticsearch.html) node-by-node?

---

<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:** [December 9, 2023, 6:21pm UTC](https://discuss.elastic.co/t/how-to-remove-master-nodes-from-the-elasticsearch-cluster/346732/9 "2023-12-09T18:21:20Z")

</div>

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