# Two node cluster - master assign

**URL:** https://discuss.elastic.co/t/two-node-cluster-master-assign/350587
**Category:** Elasticsearch
**Created:** [January 8, 2024, 2:05pm UTC](https://discuss.elastic.co/t/two-node-cluster-master-assign/350587 "2024-01-08T14:05:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Oscar\_Yerpes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oscar_yerpes/32/126115_2.png) [@Oscar\_Yerpes](https://discuss.elastic.co/u/Oscar_Yerpes)
#### Post date: [January 8, 2024, 2:05pm UTC](https://discuss.elastic.co/t/two-node-cluster-master-assign/350587/1 "2024-01-08T14:05:50Z")

</div>

Hello all,

I have a two-node cluster, with node01 designated as master:

`node.roles: [master, data, ingest]`

node02 only has

`node.roles: [data, ingest]`

In order to switch the master node, can I just simply move the **master** tag from node01 to node02, restart both nodes and be done with it?

What would be the appropriate way to do so?

Thanks,  
Oscar

---

<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: [January 8, 2024, 2:11pm UTC](https://discuss.elastic.co/t/two-node-cluster-master-assign/350587/2 "2024-01-08T14:11:41Z")

</div>

> [@Oscar\_Yerpes](#):
>
> In order to switch the master node, can I just simply move the **master** tag from node01 to node02, restart both nodes and be done with it?

You don't switch, with a 2 node cluster only one can be the master node.

---

<div class="post-metadata">

### Author: ![Oscar\_Yerpes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oscar_yerpes/32/126115_2.png) [@Oscar\_Yerpes](https://discuss.elastic.co/u/Oscar_Yerpes)
#### Post date: [January 8, 2024, 2:26pm UTC](https://discuss.elastic.co/t/two-node-cluster-master-assign/350587/3 "2024-01-08T14:26:39Z")

</div>

That's what I want to achieve. Maintain only one master node, which would be 02 instead of 01. I haven't found anything in the documentation related to this tag movement between 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: [January 8, 2024, 2:37pm UTC](https://discuss.elastic.co/t/two-node-cluster-master-assign/350587/4 "2024-01-08T14:37:18Z")

</div>

> [@Oscar\_Yerpes](#):
>
> I haven't found anything in the documentation related to this tag movement between nodes.

Because this is not recommended for production nor officially supported.

A 2 node cluster is not resilient and can only have one node as master, so it does not make sense to switch a master node in this configuration.

If your cluster is running without any issue and is _green_, it may work to shutdown both nodes, change the role, and start them again, but you would need to test it yourself.

Also, make sure you have a backup in the case something goes wrong.

---

<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: [January 8, 2024, 2:40pm UTC](https://discuss.elastic.co/t/two-node-cluster-master-assign/350587/5 "2024-01-08T14:40:30Z")

</div>

Are you looking to change the master node once just now or are you looking to make this change in case there are any issues with the master node?

Which version of Elasticsearch are you using?

---

<div class="post-metadata">

### Author: ![Oscar\_Yerpes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oscar_yerpes/32/126115_2.png) [@Oscar\_Yerpes](https://discuss.elastic.co/u/Oscar_Yerpes)
#### Post date: [January 8, 2024, 3:36pm UTC](https://discuss.elastic.co/t/two-node-cluster-master-assign/350587/6 "2024-01-08T15:36:02Z")

</div>

Hi Christian,

Version is 8.1.2

Node01 is older than 02, and we'd like to have the master on 02 for that (node01 might get retired sooner than 02).

Best,  
Oscar

---

<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: [February 5, 2024, 3:36pm UTC](https://discuss.elastic.co/t/two-node-cluster-master-assign/350587/7 "2024-02-05T15:36:22Z")

</div>

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