Principal shards Disequilibrium

After restarting the server, Principal shards Disequilibrium; Some nodes are more ,Few nodes are less, Some nodes are all replicas;

Is there any way to get the Principal shards to each node on average?

No, there is no way to ensure an even distribution of primary shards across nodes, but nor is there normally any reason to do so. Could you describe why you want this?

Elasticsearch currently balances shard count, irrespective of if they are primary or replica.

As far as I know, data writing is done on the Principal shards, and then copied to the replicas.
If most of the Principal shards are on one node, It will affect the efficiency of data writing,
if the Principal shards is average to each node, The load is equalized to each node;
I don't know if my understanding is right or not.
If I understand the mistake, I hope you can correct me.
thank you.

Whatever you index into a primary shard must also be written to its replica, so I think the I/O load will be fairly similar for a node with mostly primaries as one with mostly replicas. The main thing about primary shards is that they're responsible for sending a response back to the client that the index operation went well only after a successful update of its replica(s) so there could be some http queuing issues.

I've had clusters with nodes only containing primaries and others only replicas (which can happen when you reboot a server, forcing the cluster to assign replicas on other servers as new primaries), and I've not seen any difference in CPU load on these nodes. So I don't think you should worry about a node being all primary shards or all replicas.

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