# Elasticsearch - Changing Master-eligible nodes to dedicated Master nodes

**URL:** <https://discuss.elastic.co/t/elasticsearch-changing-master-eligible-nodes-to-dedicated-master-nodes/368387>\
**Category:** Elasticsearch\
**Created:** [October 7, 2024, 8:39pm UTC](https://discuss.elastic.co/t/elasticsearch-changing-master-eligible-nodes-to-dedicated-master-nodes/368387 "2024-10-07T20:39:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [October 7, 2024, 8:39pm UTC](https://discuss.elastic.co/t/elasticsearch-changing-master-eligible-nodes-to-dedicated-master-nodes/368387/1 "2024-10-07T20:39:29Z")

</div>

Hi All,

We have a Elasticsearch 8.12.2 cluster that was very recently set up. This cluster has 3 "Master Eligible" and 5 "Data" nodes.

When I run curl command to check cluster health it shows it as green with 8 data nodes.

I need to change the Master eligible to "Dedicated Master" nodes.

I tried shutting down the entire cluster and repurpose the Master eligble nodes. It gets re-purposed fine but for some reason the cluster health becomes red and the whole set up goes south.

I am yet to configure Kibana and other stuff.

Please help.

```auto
[ptal@elasticsearch]$ curl -k -u elastic:XXXXXXXX https://`hostname`:44444/_cluster/health?pretty
{
  "cluster_name" : "elkcluster-prod",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 8,
  "number_of_data_nodes" : 8,
  "active_primary_shards" : 1,
  "active_shards" : 2,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

```

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 7, 2024, 9:14pm UTC](https://discuss.elastic.co/t/elasticsearch-changing-master-eligible-nodes-to-dedicated-master-nodes/368387/2 "2024-10-07T21:14:21Z")

</div>

Do you have any data on the cluster that you need to keep or you can rebuild it?

It seems that your cluster is basically empty, it shows only 2 shards.

If you can rebuild it from scratch, just stop everything, delete the data folder, and then configure the master eligible nodes to have only the `master` role, then start your nodes.

---

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [October 7, 2024, 9:46pm UTC](https://discuss.elastic.co/t/elasticsearch-changing-master-eligible-nodes-to-dedicated-master-nodes/368387/3 "2024-10-07T21:46:42Z")

</div>

Thanks.

Just built this cluster today; so barely anything on it.

Shall I delete data folder from "all" the nodes or just the presently "Master eligible" ones?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 8, 2024, 12:53am UTC](https://discuss.elastic.co/t/elasticsearch-changing-master-eligible-nodes-to-dedicated-master-nodes/368387/4 "2024-10-08T00:53:36Z")

</div>

> [@zaeemmasood](#):
>
> Shall I delete data folder from "all" the nodes or just the presently "Master eligible" ones?

If you can start the cluster from scratch then you need to delete everything, from all nodes.

This will bootstrap a fresh new cluster, just make sure to configure the master nodes as master only.

---

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [October 8, 2024, 1:41am UTC](https://discuss.elastic.co/t/elasticsearch-changing-master-eligible-nodes-to-dedicated-master-nodes/368387/5 "2024-10-08T01:41:37Z")

</div>

I plan to do the following. Hope it works 😊

1. Shutdown the entire cluster (8 nodes)

2. Remove/ move data directory from all nodes

3. Update elasticsearch.yml on master nodes to reflect node.role as “Master”

4. Bring up master nodes and check log for election of a master node.

5. Bring up data nodes

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 8, 2024, 1:45am UTC](https://discuss.elastic.co/t/elasticsearch-changing-master-eligible-nodes-to-dedicated-master-nodes/368387/6 "2024-10-08T01:45:13Z")

</div>

> [@zaeemmasood](#):
>
> - Bring up master nodes and check log for election of a master node.
> - Bring up data nodes

This needs to be done at the same time as you need data nodes for the cluster to work.

So you will need to start the master nodes and the data nodes and wait for the cluster to form.
