How to distribute Primary & Replica shards equally across the nodes

Hi Team,

I have Elastic cluster with 3 Master, 5 Data & 2 Client nodes.

I have created index called my-index with 5 Primary and 1 Replica also i used setting called number of shards per node is 2.

But i could see at few nodes only 2 replicas or 2 primaries are allocated.

I would like to know is there any setting to restrict like allocate only 1 primary shards per node and 1 replica shard per node so that the primary’s will be distributed equally and ingestion will be faster.

Thanks,

Primary and replica shard do mostly the same work when indexing so this allocation should not matter much. You can not control it and Elasticsearch can change it at any time in response to cluster events.

Be aware that setting nax number of shards per node too tightly may cause some replca shards to not be allocated should a node fail.

1 Like

Thanks for the details.

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