Index distribution clarification

I am trying to add a node in my cluster running on 7.17x with 3 existing nodes ( master eligible ), the new 4th node is data only node.

I am seeing new index have all primary shards allocated to 1 node, shouldn't they be allocated to all nodes with their replica allocated to some other node ?

I have index set to "cluster.routing.rebalance.enable": "all"

No, that is not a correct assumption... as long as the primary and replica are on different nodes, that is sufficient. Nothing says the primaries need to be spread out. That said, over time, that can / will happen, but when you add a new node, that is not necessarily the case... over time, shards will balance.

Think about a 2 node cluster with 1 primary and 1 replica... all the primaries could be on 1 node and all the replicas could be on another, that is perfectly fine.

There is a setting to accomplish what you want but you need to be careful..with it.

If you apply it wrongly or you do not have enough nodes, then the index will fail to allocate. Unless you are experienced with Elasticsearch I would be careful with this.

1 Like

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