# To use or not to use NodeSelector.SKIP\_DEDICATED\_MASTERS with high level rest client

**URL:** <https://discuss.elastic.co/t/to-use-or-not-to-use-nodeselector-skip-dedicated-masters-with-high-level-rest-client/278310>\
**Category:** Elasticsearch\
**Created:** [July 9, 2021, 11:28pm UTC](https://discuss.elastic.co/t/to-use-or-not-to-use-nodeselector-skip-dedicated-masters-with-high-level-rest-client/278310 "2021-07-09T23:28:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blindwitness](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blindwitness/32/87433_2.png) [@blindwitness](https://discuss.elastic.co/u/blindwitness)\
**Post date:** [July 9, 2021, 11:28pm UTC](https://discuss.elastic.co/t/to-use-or-not-to-use-nodeselector-skip-dedicated-masters-with-high-level-rest-client/278310/1 "2021-07-09T23:28:10Z")

</div>

Hello,

The documentation is slightly unclear in regards to using NodeSelectors for the rest client.

We have a cluster with dedicated master-eligible nodes and dedicated data/ingest nodes. It seems that with this configuration, the suggestion is to set NodeSelector.SKIP\_DEDICATED\_MASTERS on the rest client when building it so that all requests round-robin between the data/ingest nodes and not the master-eligible ones.

However, there is [this](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/_node_selector.html#_node_selector) page in the documentation that says "This is useful when sniffing is enabled, in case only dedicated master nodes should be hit by HTTP requests", which seems to contradict [this](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-low-usage-initialization.html#CO3-1) page in the documentation that says "This is useful for instance to prevent sending requests to dedicated master nodes when sniffing is enabled".

Additionally, there is [this](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-node.html#master-node) page in the documentation that says "The master node is responsible for lightweight cluster-wide actions such as creating or deleting an index...", which seems to indicate that you would want certain types of requests to go to master-eligible nodes.

So, I'm a bit turned around on whether or not to use this NodeSelector setting with my configuration and am hoping to have this cleared up if possible.

TLDR - I have dedicated master-eligible nodes and dedicated data/ingest nodes, should I set or should I not set NodeSelector.SKIP\_DEDICATED\_MASTERS on my rest client when building it?

Thanks!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 12, 2021, 8:24am UTC](https://discuss.elastic.co/t/to-use-or-not-to-use-nodeselector-skip-dedicated-masters-with-high-level-rest-client/278310/2 "2021-07-12T08:24:12Z")

</div>

That sentence in the first paragraph looks like a typo to me and should be negated. I will open up a PR for this and fix it.

In general the right way is to **not** send requests to dedicated master nodes. So that node selector is a good idea to use, when you have dedicated master nodes.

**Update** : Opened [Docs: Fix node selector documentation by spinscale · Pull Request #75217 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/pull/75217)

---

<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 9, 2021, 8:24am UTC](https://discuss.elastic.co/t/to-use-or-not-to-use-nodeselector-skip-dedicated-masters-with-high-level-rest-client/278310/3 "2021-08-09T08:24:33Z")

</div>

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