# Cluster's node distributed in two subnets

**URL:** <https://discuss.elastic.co/t/clusters-node-distributed-in-two-subnets/204372>\
**Category:** Elasticsearch\
**Created:** [October 20, 2019, 5:19pm UTC](https://discuss.elastic.co/t/clusters-node-distributed-in-two-subnets/204372 "2019-10-20T17:19:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsmbalu](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tsmbalu](https://discuss.elastic.co/u/tsmbalu)\
**Post date:** [October 20, 2019, 5:19pm UTC](https://discuss.elastic.co/t/clusters-node-distributed-in-two-subnets/204372/1 "2019-10-20T17:19:25Z")

</div>

We have created elasticsearch cluster with 4 nodes which is distributed in two subnets of aws with all the nodes with the role assigned as master, data, ingest and. It was all discovered and master node is elected. While data ingest all the nodes are used and data ingestion correctly. But when we query the elasticsearch service only 2 nodes are utilized (1 is the master and another node in the same subnet) but other 2 nodes in second subnet are not getting used even there is any heavy usage on the first 2 nodes.  
When we have all the node under one subnet then all the server are getting used equally. I can't get the root cause of this issue.

Version: Elasticsearch 7.1.1

---

<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:** [October 20, 2019, 5:45pm UTC](https://discuss.elastic.co/t/clusters-node-distributed-in-two-subnets/204372/2 "2019-10-20T17:45:36Z")

</div>

Are you using [shard allocation awareness](https://www.elastic.co/guide/en/elasticsearch/reference/7.1/allocation-awareness.html)? If so, is this the explanation?

> Elasticsearch prefers using shards in the same location (with the same awareness attribute values) to process search or GET requests.

If you do not want this behaviour then you can disable it by adding another awareness attribute which only has one value across the whole cluster, e.g.

```auto
cluster.routing.allocation.awareness.attributes: rack_id,cluster_id
node.attr.cluster_id: my_cluster

```

This will have no effect on shard allocation but will route searches across the whole cluster.

In 7.5.0 and later you can set the system property `es.routing.search_ignore_awareness_attributes` to `true` instead, and in 8.0.0 this will be the default behaviour.

---

<div class="post-metadata">

**Author:** ![tsmbalu](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tsmbalu](https://discuss.elastic.co/u/tsmbalu)\
**Post date:** [October 20, 2019, 6:46pm UTC](https://discuss.elastic.co/t/clusters-node-distributed-in-two-subnets/204372/3 "2019-10-20T18:46:31Z")

</div>

Great, I go through so in my case I was using aws ec2 instance for es cluster. The following attributes will do the same right

cluster.routing.awareness.attributes: aws\_availability\_zone  
cloud.node.auto\_attributes: true  
node.attr.aws\_availability\_zone: my\_cluster

Worked fine.

---

<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:** [November 17, 2019, 6:46pm UTC](https://discuss.elastic.co/t/clusters-node-distributed-in-two-subnets/204372/4 "2019-11-17T18:46:33Z")

</div>

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