# Exclude master node from query user operations - how?

**URL:** <https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636>\
**Category:** Elasticsearch\
**Created:** [January 17, 2022, 10:04pm UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636 "2022-01-17T22:04:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sale/32/100242_2.png) [@sale](https://discuss.elastic.co/u/sale)\
**Post date:** [January 17, 2022, 10:04pm UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636/1 "2022-01-17T22:04:16Z")

</div>

We have a 11 node Elasticsearch cluster (3 master-eligible node + 8 data nodes). We perform all operations (ingesting, search etc) using REST calls. The master nodes are lightweight as compared to data nodes.

For the sake of configuration simplicity, we specify only the master nodes as the connection string in our client code, like so:  
`master-01:9200,master-02:9200,master-03:9200`

We do also have `sniff_at_start=True` setting in our clients so entire cluster topology is discovered by clients.

I realized the master node will continue to work as coordinating nodes, handle search and execute the reduce phase of search. Is there a way to configure these nodes to be ONLY master nodes and not participate in searches?  
My concern is, when executing large queries the results from data nodes could overwhelm the master node during reduce phase.

Any suggestion/input will be helpful.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 18, 2022, 3:40am UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636/2 "2022-01-18T03:40:53Z")

</div>

> [@sale](#):
>
> Is there a way to configure these nodes to be ONLY master nodes and not participate in searches?

Don't point your clients to them is a good starting point.

What client are you using?

---

<div class="post-metadata">

**Author:** ![sale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sale/32/100242_2.png) [@sale](https://discuss.elastic.co/u/sale)\
**Post date:** [January 18, 2022, 3:26pm UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636/3 "2022-01-18T15:26:37Z")

</div>

Thanks for the response.  
If not point to master, point to where then?  
Reason i ask, we certainly don't want to include all 8 data nodes in the initial connection string. So, it seems we should point to some of the data nodes and pick some out of 8. Is there no better way than this?  
We may add/remove data nodes in the future and don't want to keep adjusting app configuration because of that.

Since we are still on 5.5 - we are using [GitHub - elastic/elasticsearch-py-async: Backend for elasticsearch-py based on python's asyncio module.](https://github.com/elastic/elasticsearch-py-async)

---

<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 18, 2022, 4:22pm UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636/4 "2022-01-18T16:22:13Z")

</div>

What you want is a Coordinating Only Node, as described in this [part of the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-node.html#coordinating-node).

> Every node is implicitly a coordinating node. This means that a node that has all three `node.master` , `node.data` and `node.ingest` set to `false` will only act as a coordinating node, which cannot be disabled.

---

<div class="post-metadata">

**Author:** ![sale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sale/32/100242_2.png) [@sale](https://discuss.elastic.co/u/sale)\
**Post date:** [January 18, 2022, 5:19pm UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636/5 "2022-01-18T17:19:45Z")

</div>

Thanks for pointing to the docs. I am aware of coordinating-only nodes. It implies that we will need more than one such node for high availability.

It seems these nodes should have decent amount of memory to handle bulk & reduce phase of search and for that reason will cost quiet a bit to run.

IMO, our cluster is not large enough to warrant the cost of running a dedicated node for this and not a cost effective solution.

---

<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 18, 2022, 6:06pm UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636/6 "2022-01-18T18:06:27Z")

</div>

Without using coordinating only nodes, not pointing to the masters, and not configuring all your data nodes as they could change, another option would be to use a load balancer, like HAProxy or Nginx in front of your data nodes, so you would configure only this endpoint in your client and configure your data nodes on the load balancer.

---

<div class="post-metadata">

**Author:** ![sale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sale/32/100242_2.png) [@sale](https://discuss.elastic.co/u/sale)\
**Post date:** [January 18, 2022, 6:25pm UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636/7 "2022-01-18T18:25:25Z")

</div>

This makes a lot of sense @leandrojmp -- thanks!!!  
Didn't think of reverse proxy.

---

<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 15, 2022, 6:25pm UTC](https://discuss.elastic.co/t/exclude-master-node-from-query-user-operations-how/294636/8 "2022-02-15T18:25:51Z")

</div>

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