Cluster's node distributed in two subnets

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

Are you using shard allocation awareness? 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.

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.

1 Like

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.

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