# Correct usage of Coordinating role node

**URL:** <https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988>\
**Category:** Elasticsearch\
**Created:** [December 1, 2017, 10:34pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988 "2017-12-01T22:34:32Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 1, 2017, 10:34pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/1 "2017-12-01T22:34:33Z")

</div>

hi everybody,  
currently, I have in theory 2 DATA nodes, 1 active MASTER , 1 passive MASTER (I mean, could only be a master, but it is not elected) and 1 COORDINATOR (with Kibana installed on it).

I would like to know if I want to try a manual insert operation (PUT), should I aim to COORDINATOR node or to MASTER (in this case, how can I know which is the IP address)?  
and if I try a GET?

---

<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:** [December 2, 2017, 10:47am UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/2 "2017-12-02T10:47:38Z")

</div>

Having 2 master eligible nodes in a cluster is a bad idea. You should always aim to have exactly 3 so two nodes can elect a new master should one fail or leave. I would therefore recommend that you set up 3 equally sized nodes that hold data and are master eligible. In addition to this you can use a coordinating only node with Kibana.

With this setup, you would direct indexing operations at the master/data nodes.

If having 3 data nodes is not an option, I would recommend setting up the cluster with 2 master/data nodes and one smaller dedicated master node. In this configuration you would send all indexing request to one of the master/data nodes. In addition to this you can use a coordinating only node with Kibana.

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 2, 2017, 12:31pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/3 "2017-12-02T12:31:29Z")

</div>

in this moment I have just 2 Master nodes for a test. anyway, I can try this configuration: I have 3 Master nodes that are also Data nodes. I have also 1 Coordinating only node (with Kibana installed on it).  
Should I send my PUT and GET requests to Master node or to my Coordinating node?

---

<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:** [December 2, 2017, 12:42pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/4 "2017-12-02T12:42:38Z")

</div>

I would send indexing requests directly to the data nodes in such a setup. Kibana would go via the coordinating node. Other queries can hit either - it all depends on volumes and how powerful your coordinating node is.

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 2, 2017, 12:51pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/5 "2017-12-02T12:51:04Z")

</div>

so, technically both Master and Data nodes can be aimed to send my requests (PUT or GET is not important)?  
if I can use Data node for this purpose, why should I aim to Master?

I know that Filebeat and LS can use `hosts` keyword to send messages to an array of servers (if the first one is not alive, will be contacted the other ones), but if I have a third application, create by mine, where should I send my PUT and GET requests? should I use a virtual appliance for load balancing?

---

<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:** [December 2, 2017, 12:53pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/6 "2017-12-02T12:53:12Z")

</div>

If you have dedicated master nodes, you should not send requests to these. If you however have master/data nodes (both roles) these can serve requests.

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 2, 2017, 1:03pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/7 "2017-12-02T13:03:14Z")

</div>

ok, understood: I should use Master because it has this specific purpose 😀

and if I'm implementing my application to send requests, which has the possibility to aim all the different Master nodes of my infrastructure, should I forecast also the mechanism of probing which server is my elected Master?  
I mean, what will happen if I try to send a PUT/GET request to a Master node that is currently not elected? Will my request fail?

---

<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:** [December 2, 2017, 1:23pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/8 "2017-12-02T13:23:37Z")

</div>

If you have master+data nodes, send to them without caring which one is currently the master (as this can change), but avoid sending data to any dedicated master nodes (if you have any). The node that is currently elected master manages the state of the cluster - it is involved in normal requests (at least not because it happens to be the master).

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 2, 2017, 1:58pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/9 "2017-12-02T13:58:04Z")

</div>

hmmm....this concept is not really clear to me.  
I cannot send messages (i.e. from FB) to only Master node?

---

<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:** [December 2, 2017, 1:58pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/10 "2017-12-02T13:58:43Z")

</div>

You can, but generally you should not. The whole point of having dedicated master nodes is to ensure they are not overloaded so that they can concentrate on managing the cluster. This is why you should not put load on thyem by sending requests to them.

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 2, 2017, 2:02pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/11 "2017-12-02T14:02:24Z")

</div>

ok, so I should send messages to my DATA node.  
but, if my cluster will be stopped because could not be possible to have the minimum number of Master node, also Data nodes will refuse new messages automatically?

---

<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:** [December 2, 2017, 2:05pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/12 "2017-12-02T14:05:08Z")

</div>

If the cluster is not able to elect a master, write requests will be rejected. This is the correct and expected behaviour as accepting writes without an elected master could cause data loss. This is why you ideally have 3 master eligible nodes, so that you can handle a node failing and still be able to elect a master.

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 2, 2017, 2:35pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/13 "2017-12-02T14:35:24Z")

</div>

no, just to start I should have:  
2 DATA nodes where I will send my messages  
3 MASTER nodes that will manage cluster (and anything else?)  
1 Coordinating only role (with Kibana installed that will aim localhost:9200)

could be a good idea?

---

<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:** [December 2, 2017, 2:50pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/14 "2017-12-02T14:50:11Z")

</div>

That will work fine, but if you only have 2 data nodes, having 3 dedicated master nodes may be overkill. I would recommend starting with 3 nodes that hold data and are all master eligible plus a coordinating only node for Kibana.

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 2, 2017, 3:54pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/15 "2017-12-02T15:54:42Z")

</div>

latest question: when, using Kibana, I send a request of query and Coordinating role will handle it, this request will be also managed by Master elected node or directly by DATA?

---

<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:** [December 2, 2017, 4:06pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/16 "2017-12-02T16:06:49Z")

</div>

The processing of normal requests have nothing to do with the master node.

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [December 2, 2017, 4:18pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/17 "2017-12-02T16:18:37Z")

</div>

so Coordinating role, since knows the status of all nodes of the cluster, will contact directly the best possible Data node to get the result of the query?

---

<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:** [December 2, 2017, 6:08pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/18 "2017-12-02T18:08:33Z")

</div>

Yes.

---

<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 30, 2017, 6:08pm UTC](https://discuss.elastic.co/t/correct-usage-of-coordinating-role-node/109988/19 "2017-12-30T18:08:43Z")

</div>

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