# Which is the main master in 3 dedicated master node?

**URL:** <https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264>\
**Category:** Elasticsearch\
**Created:** [July 8, 2020, 5:34am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264 "2020-07-08T05:34:29Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divit\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divit_sharma/32/32348_2.png) [@Divit\_Sharma](https://discuss.elastic.co/u/Divit_Sharma)\
**Post date:** [July 8, 2020, 5:34am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/1 "2020-07-08T05:34:29Z")

</div>

Suppose I have a 3 dedicated master node and 4 data nodes. At a moment are all 3 acting as a master or is there a supreme master between them so that when it goes down another is elected as Supreme Master ?

Are 3 master acting together at one time with each controlling some primary shards? So when one goes down, another master will take its primary shards and that will be done by voting?

---

<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:** [July 8, 2020, 5:37am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/2 "2020-07-08T05:37:47Z")

</div>

One of the nodes will be acting as master at any time with the others monitoring and waiting to step in if required.

---

<div class="post-metadata">

**Author:** ![Divit\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divit_sharma/32/32348_2.png) [@Divit\_Sharma](https://discuss.elastic.co/u/Divit_Sharma)\
**Post date:** [July 8, 2020, 5:59am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/3 "2020-07-08T05:59:00Z")

</div>

Thanks for the reply. But then what is the need to make a 3 node cluster. I can also make a 2 node cluster right, with one of my data nodes as voting node.

Also can you point me to an article where these things are explained?

---

<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:** [July 8, 2020, 6:15am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/4 "2020-07-08T06:15:51Z")

</div>

You can make 3 if your data nodes master eligible and skip dedicated master nodes altogether and the cluster will still work. Having dedicated master nodes is usually recommended for large clusters and/or very busy clusters where e.g. load may lead to long GC or the current master node not having enough resources to complete tasks in a timely fashion.

---

<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:** [July 8, 2020, 6:18am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/5 "2020-07-08T06:18:35Z")

</div>

> [@Divit\_Sharma](#):
>
> Also can you point me to an article where these things are explained?

See for instance [Resilience in small clusters | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/high-availability-cluster-small-clusters.html) and the surrounding pages in the manual.

---

<div class="post-metadata">

**Author:** ![Divit\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divit_sharma/32/32348_2.png) [@Divit\_Sharma](https://discuss.elastic.co/u/Divit_Sharma)\
**Post date:** [July 13, 2020, 9:24am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/6 "2020-07-13T09:24:04Z")

</div>

Hi, suppose I have 2 dedicated master and 3 data nodes. One of the data nodes is also voting eligible.  
Suppose m1 is active master.  
If m1 and m2 loses communication, will m2 elect itself as master since data node can vote in master election process. Will this cause split brain?

---

<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:** [July 13, 2020, 9:35am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/7 "2020-07-13T09:35:45Z")

</div>

You should ALWAYS look to have at least three master eligible nodes in a cluster, never two.

---

<div class="post-metadata">

**Author:** ![Divit\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divit_sharma/32/32348_2.png) [@Divit\_Sharma](https://discuss.elastic.co/u/Divit_Sharma)\
**Post date:** [July 13, 2020, 10:40am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/8 "2020-07-13T10:40:16Z")

</div>

Yes you are correct but I want to understand the reasons. Will voting only data node help in avoiding splitbrain if there are 2 dedicated masters?

M1 is active. Suppose m1 and m2 goes lose communication between them. How would the master election process proceed from here? M1 is already master and has connections to all data nodes. M2 thinks other master is dead so will try to elect itself as master right. So will the data node vote it and make it a second active master hence causing splitbrain Or voting only data nodes gets to vote only in case of tiebreaker?

---

<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:** [July 13, 2020, 10:41am UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/9 "2020-07-13T10:41:50Z")

</div>

The third node will determine which of the other nodes that is elected. Only one can succeed.

---

<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:** [July 13, 2020, 12:09pm UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/10 "2020-07-13T12:09:34Z")

</div>

Yes, M2 will think M1 has failed but none of the other nodes will agree, so it won't be elected.

---

<div class="post-metadata">

**Author:** ![Divit\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divit_sharma/32/32348_2.png) [@Divit\_Sharma](https://discuss.elastic.co/u/Divit_Sharma)\
**Post date:** [July 13, 2020, 12:15pm UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/11 "2020-07-13T12:15:54Z")

</div>

Thanks a lot. That's what I needed.

So though not ideal but we can have 2 dedicated master node with one of the data node as voting only correct? This won't cause split brain?

---

<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:** [July 13, 2020, 12:22pm UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/12 "2020-07-13T12:22:43Z")

</div>

Indeed, you're safe from split-brain inconsistencies no matter what your configuration. Note that [the manual suggests exactly this configuration](https://www.elastic.co/guide/en/elasticsearch/reference/current/high-availability-cluster-small-clusters.html#high-availability-cluster-design-three-plus-nodes) (emphasis mine):

> You may configure one of your master-eligible nodes to be a [voting-only node](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#voting-only-node) so that it can never be elected as the master node. For instance, you may have two dedicated master nodes and **a third node that is both a data node and a voting-only master-eligible node**. This third voting-only node will act as a tiebreaker in master elections but will never become the master itself.

---

<div class="post-metadata">

**Author:** ![Divit\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divit_sharma/32/32348_2.png) [@Divit\_Sharma](https://discuss.elastic.co/u/Divit_Sharma)\
**Post date:** [July 13, 2020, 12:45pm UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/13 "2020-07-13T12:45:25Z")

</div>

Thanks. The terminology 'master eligible' for voting only node is very bad.

---

<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:** [July 13, 2020, 12:50pm UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/14 "2020-07-13T12:50:36Z")

</div>

This too is [documented](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#voting-only-node):

> It may seem confusing to use the term "master-eligible" to describe a voting-only node since such a node is not actually eligible to become the master at all. This terminology is an unfortunate consequence of history: master-eligible nodes are those nodes that participate in elections and perform certain tasks during cluster state publications, and voting-only nodes have the same responsibilities even if they can never become the elected master.

---

<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:** [August 10, 2020, 12:50pm UTC](https://discuss.elastic.co/t/which-is-the-main-master-in-3-dedicated-master-node/240264/15 "2020-08-10T12:50:36Z")

</div>

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