# How to change Elected master role to master in ES 2.4.0?

**URL:** <https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439>\
**Category:** Elasticsearch\
**Created:** [January 23, 2017, 7:35am UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439 "2017-01-23T07:35:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [January 23, 2017, 7:35am UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/1 "2017-01-23T07:35:01Z")

</div>

I have ES 2.4.0. I am having a cluster that is running by 3 nodes when i given the following command `http://localhost:9200/_cat/nodes?v` i got to see there stats like these

```
host ip heap.percent ram.percent load node.role master name     
127.0.0.1 127.0.0.1 7 73 -1.00 d m Aguja    
127.0.0.1 127.0.0.1 7 73 -1.00 d m Hardwire 
127.0.0.1 127.0.0.1 3 73 -1.00 d * Glitch  

```

The node.role and master is done by default as it is given in the documentation [https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-node.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-node.html)

In the above stats you can able to see the master eligible node (i.e Glitch) and its role is datanode(d) . Eventhough it is elected master it is performing the responsibilites of both the master and also datanode.

My question is :  
1)Since the Glitch is doing both master and data node tasks whether the performance of the node Glitch will be slow? and also is it a good practice in doing so?  
2)Can i able to declare the node.role as dedicated master for the Glitch?

Thanks..

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [January 23, 2017, 5:53pm UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/2 "2017-01-23T17:53:44Z")

</div>

What version of ES are you using? I just tested on master and 5.1.2 and  
`/_cat/nodes` is showing `mdi` for master, data, and ingestion.

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [January 23, 2017, 5:53pm UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/3 "2017-01-23T17:53:59Z")

</div>

Also, have you configured any specific roles in your elasticsearch.yml file?

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [January 24, 2017, 6:13am UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/4 "2017-01-24T06:13:34Z")

</div>

Since i am using ES 2.4 by default every node will be master-eligible and role as datanode(d).

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [January 24, 2017, 7:30pm UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/5 "2017-01-24T19:30:27Z")

</div>

It looks like this is indeed something that shows up with 2.4, in 2.4,  
`node.role` has a different output:

```
node.role | r,role,dc,nodeRole | d:data node, c:client node

```

Where it only shows either `d` or `c` depending on the role. In 5.x it will show  
all the roles the node has been assigned.

In your case, `node.role` is showing `d` because they are allowed to have data,  
and also showing `*` and `m` because the nodes are master eligible.

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [January 25, 2017, 6:20am UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/6 "2017-01-25T06:20:20Z")

</div>

Thanks for your response ..  
But what i want to know is different . Please go through my updated question.  
Thanks..

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [January 25, 2017, 9:38am UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/7 "2017-01-25T09:38:05Z")

</div>

> [@Yaswanth](#):
>
> Since the Glitch is doing both master and data node tasks whether the performance of the node Glitch will be slow? and also is it a good practice in doing so?

Good practice is for production systems to have **3**  **dedicated** master-eligible nodes - any other option represents an architectural compromise.

- **dedicated** because asking a master node to also perform indexing or searching duties can put it under stress that prevents it from performing important (but lightweight) management functions necessary for a responsive cluster.

- **3** nodes because 1 represents a single point of failure and 2 has split-brain potential. Any more than 3 just means machines sat idle.

This is a one-size-fits-all recommendation. Inevitably people may want to cut corners so it is important to understand what you are compromising if you choose to have less than 3 master eligible nodes or force your master-eligible nodes to also take on data searching/indexing roles that might make them unresponsive under heavy load.

> [@Yaswanth](#):
>
> Can i able to declare the node.role as dedicated master for the Glitch?

A _dedicated_ master has node.data setting set to false.

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [January 25, 2017, 10:40am UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/8 "2017-01-25T10:40:42Z")

</div>

Thanks for your response.Your are saying [quote="Mark\_Harwood, post:7, topic:72439"]  
A dedicated master has node.data setting set to false.  
[/quote]

But my question is "Glitch is elected master node then why its node.role is d(data.node) rather than m(master).  
Can i able to change node.role to m(master) for Glitch? Is it possible?

Thanks

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [January 25, 2017, 10:45am UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/9 "2017-01-25T10:45:21Z")

</div>

> [@Yaswanth](#):
>
> why its node.role is d(data.node) rather than m(master).

It is both. @dakrone answered that in his last comment - it's the formatting of the cat output in 2.4

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [January 25, 2017, 1:01pm UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/10 "2017-01-25T13:01:15Z")

</div>

You are saying that Glitch is both master and data node .  
In the \_cat/nodes output of 2.4 they formatted m.

Pls correct me if i am wrong..

Thanks

---

<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 25, 2017, 1:13pm UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/11 "2017-01-25T13:13:49Z")

</div>

`m` means that the node is master eligible, but currently not acting as the master in the cluster. `*` indicates the master eligible node that is currently acting as 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:** [February 22, 2017, 1:13pm UTC](https://discuss.elastic.co/t/how-to-change-elected-master-role-to-master-in-es-2-4-0/72439/12 "2017-02-22T13:13:48Z")

</div>

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