Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch Primary Shards not balanced

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.

Screenshot

like image 513
Matthias Avatar asked Feb 14 '14 08:02

Matthias


People also ask

How do you fix Elasticsearch unassigned shards?

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.

Why do shards fail in Elasticsearch?

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 ...

How many primary shards are created by default?

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.


1 Answers

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

like image 159
mconlin Avatar answered Sep 24 '22 05:09

mconlin