# Default index shard allocation

**URL:** <https://discuss.elastic.co/t/default-index-shard-allocation/20413>\
**Category:** Elasticsearch\
**Created:** [October 24, 2014, 1:20am UTC](https://discuss.elastic.co/t/default-index-shard-allocation/20413 "2014-10-24T01:20:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raidex\_sym](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@raidex\_sym](https://discuss.elastic.co/u/raidex_sym)\
**Post date:** [October 24, 2014, 1:20am UTC](https://discuss.elastic.co/t/default-index-shard-allocation/20413/1 "2014-10-24T01:20:01Z")

</div>

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?

Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/abbefd82-579e-452a-8922-29dcb099cce6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/abbefd82-579e-452a-8922-29dcb099cce6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 24, 2014, 1:41am UTC](https://discuss.elastic.co/t/default-index-shard-allocation/20413/2 "2014-10-24T01:41:54Z")

</div>

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](mailto: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?
> 
> Thanks.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/abbefd82-579e-452a-8922-29dcb099cce6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/abbefd82-579e-452a-8922-29dcb099cce6%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/abbefd82-579e-452a-8922-29dcb099cce6%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/abbefd82-579e-452a-8922-29dcb099cce6%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd38%2B0Zyn9hrWPecG6ifcLKYee%2B8k3g\_LampExUscP0kcg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd38%2B0Zyn9hrWPecG6ifcLKYee%2B8k3g_LampExUscP0kcg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:54am UTC](https://discuss.elastic.co/t/default-index-shard-allocation/20413/3 "2017-07-06T00:54:04Z")

</div>


