Is there any way to ask Elasticsearch why it allocated a shard to a specific node?
I've got a couple of different types of indexes in ES (some with small numbers of documents, others with millions more), and after rebooting various nodes to apply updates and, I've got an imbalanced cluster (all the million+ shards are allocated to one node).
Nothing obvious in the cluster or index settings is standing out as to why it's not allocating to the others. If ES can tell me "Index A, Shard B cannot be allocated to Node X because of [y,z]" then that'd be great.
Elasticsearch's allocation weights all shards the same. See the pull request below for some of the reasoning as to why. At some point in the future it'll have more, better ways of tuning this stuff, but for now your best bet is setting index.routing.allocation.total_shards_per_node on the big indexes.
thanks @nik9000
To ensure even allocation of primaries to all nodes, we are setting a bit higher-number to below setting -
cluster.routing.allocation.balance.primary
This was done to overcome issue where one of our 5 data nodes had all primary shards of all indices. We used guess and trial number, do we see any side-effect of messing up with this number :)?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.