# Homogeneous distribution of primary shards

**URL:** https://discuss.elastic.co/t/homogeneous-distribution-of-primary-shards/16713
**Category:** Elasticsearch
**Created:** [March 31, 2014, 10:53am UTC](https://discuss.elastic.co/t/homogeneous-distribution-of-primary-shards/16713 "2014-03-31T10:53:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vidaInfinita](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@vidaInfinita](https://discuss.elastic.co/u/vidaInfinita)
#### Post date: [March 31, 2014, 10:53am UTC](https://discuss.elastic.co/t/homogeneous-distribution-of-primary-shards/16713/1 "2014-03-31T10:53:10Z")

</div>

Good morning,

I have a cluster with 15 nodes. When one of the nodes goes down, and restart  
it again, we have seen that sometimes runs out of primary shards. Is there  
any parameter to ensure that all primary shards are distributed evenly across  
the cluster?

Regards and thanks in advance

--  
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/4dd8cd15-357c-423d-962c-b2fff57b1eab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4dd8cd15-357c-423d-962c-b2fff57b1eab%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)
#### Post date: [March 31, 2014, 10:00pm UTC](https://discuss.elastic.co/t/homogeneous-distribution-of-primary-shards/16713/2 "2014-03-31T22:00:44Z")

</div>

If you have 1 or more replicas, then when a node goes down that contains  
primary shards, one of the existing replica shards should get promoted to a  
primary shard.

--  
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/6d497c13-152d-476e-92c2-14f937f9e174%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6d497c13-152d-476e-92c2-14f937f9e174%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![vidaInfinita](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@vidaInfinita](https://discuss.elastic.co/u/vidaInfinita)
#### Post date: [April 1, 2014, 8:10am UTC](https://discuss.elastic.co/t/homogeneous-distribution-of-primary-shards/16713/3 "2014-04-01T08:10:04Z")

</div>

Our problem is not that no other nodes are not promoted to primary when the  
node is down, Our problem is that when the node is down and after is up,  
sometimes the node is out of primary shards. This problem cause that the  
swing of charge is not swing across this node. we need that all nodes  
contain the same number of primary shards so that the load swings to all  
nodes.

--  
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/9d675854-340b-4787-854a-958af5e98d73%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d675854-340b-4787-854a-958af5e98d73%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 1, 2014, 8:23am UTC](https://discuss.elastic.co/t/homogeneous-distribution-of-primary-shards/16713/4 "2014-04-01T08:23:31Z")

</div>

Sounds like you just need to give ES some time to rebalance.

Otherwise look at this, maybe you can adapt it to suit -

> **[ElasticSearch Shard Placement Control - Sematext](https://sematext.com/blog/elasticsearch-shard-placement-control/)**
>
> In this post you will learn how to control ElasticSearch shard placement.  If you are coming to our ElasticSearch talk at BerlinBuzzwords, we’ll be talking about this and more. If you’ve ever used ElasticSearch you probably know that you can set...

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 1 April 2014 19:10, Pedro Plaza García [pedrito1987@gmail.com](mailto:pedrito1987@gmail.com) wrote:

> Our problem is not that no other nodes are not promoted to primary when  
> the node is down, Our problem is that when the node is down and after is  
> up, sometimes the node is out of primary shards. This problem cause that  
> the swing of charge is not swing across this node. we need that all nodes  
> contain the same number of primary shards so that the load swings to all  
> nodes.
> 
> --  
> 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/9d675854-340b-4787-854a-958af5e98d73%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d675854-340b-4787-854a-958af5e98d73%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/9d675854-340b-4787-854a-958af5e98d73%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9d675854-340b-4787-854a-958af5e98d73%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/CAEM624Ysi3p10m8%3Dsce4pu\_X96qWomE%2BccA3950spby1QTyEVQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624Ysi3p10m8%3Dsce4pu_X96qWomE%2BccA3950spby1QTyEVQ%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, 1:39am UTC](https://discuss.elastic.co/t/homogeneous-distribution-of-primary-shards/16713/5 "2017-07-06T01:39:04Z")

</div>


