Clarification on shard allocation with 4 nodes across 3 zones using awareness

Hi,

I’d like to clarify how shard allocation behaves in a specific setup using shard allocation awareness.

Cluster setup:

  • 4 data nodes

  • 3 zones (AZ-A, AZ-B, AZ-C)

    • AZ-A: 2 nodes

    • AZ-B: 1 node

    • AZ-C: 1 node

  • Index: 300 primary shards + 300 replicas (replica count = 1)

  • Setting: cluster.routing.allocation.awareness.attributes: zone

Question:

In this configuration, what is the expected shard distribution?

Specifically:

  • Does Elasticsearch prioritize even distribution per zone (about 200 shards per zone)?

  • Or does it try to balance shards per node (around 150 per node), even if this creates uneven zone distribution?

Thanks in advance for the clarification.

Neither. Each shard only has 2 copies, so with 3 zones allocation awareness ensures that each zone has no more than ⌈2/3⌉ = 1 copy. It does not consider other shards in the same index.