I noticed a strange behaviour in my elasitcsearch cluster. As you can see on the screenshot below (it shows the "kopf"-plugin), most of the primary shards are located on the nl-1 server. I thought, that elasitcsearch balanced the primary shards evenly over all servers. Am I wrong or why is this happening?
Thank you for your help.
In this scenario, you have to decide how to proceed: try to get the original node to recover and rejoin the cluster (and do not force allocate the primary shard), or force allocate the shard using the Cluster Reroute API and reindex the missing data using the original data source, or from a backup.
This can occur due to various reasons, such as: if text fields are being used for document aggregations or performing metric aggregation; if a given search failed on the shard and is in an unrecoverable state, and therefore no response could be given for that shard (though the shard itself is fine); or some special ...
primary vs replica shards – elasticsearch will create, by default, 5 primary shards and one replica for each index. That means that each elasticsearch index will be split into 5 chunks and each chunk will have one copy, for high availability.
I dont think balance of primaries is a focus of ES.
See this github issues question about it here
There is a cluster settings you can tweak to nudge towards balancing them.
cluster.routing.allocation.balance.primary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With