I am trying to understand Elasticsearch default rules for shard allocation.
I have 6 nodes and created a test index with all default settings (5
shards, 1 replica). To my surprise, all 5 primary shards are collocated in
a single node (the node to which the creation request was sent -- not sure
if this is coincidence) while replicas are spread around. I realize this
configuration is contrived, but I would appreciate any help in
understanding why the primary shards are not being scattered.
My cluster and indexes all report healthy status. I have created other
indices with similar effects: even a 12-shard index seems very unevenly
distributed over the 6 nodes (some nodes only hold replicas). Is it
reasonable to expect a more even shard distribution without tweaking shard
allocations manually?
Primary shards in elasticsearch don't really do much more work than
replicas. Elasticsearch doesn't worry too much about them but tries to
balance the total number of shards (including replicas) across all nodes.
You can fiddle with that using the allocation settings if you need to.
On Oct 23, 2014 9:20 PM, raidex.sym@gmail.com wrote:
I am trying to understand Elasticsearch default rules for shard
allocation. I have 6 nodes and created a test index with all default
settings (5 shards, 1 replica). To my surprise, all 5 primary shards are
collocated in a single node (the node to which the creation request was
sent -- not sure if this is coincidence) while replicas are spread around.
I realize this configuration is contrived, but I would appreciate any help
in understanding why the primary shards are not being scattered.
My cluster and indexes all report healthy status. I have created other
indices with similar effects: even a 12-shard index seems very unevenly
distributed over the 6 nodes (some nodes only hold replicas). Is it
reasonable to expect a more even shard distribution without tweaking shard
allocations manually?
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.