# Force shards rebalance when new empty node has joined

**URL:** <https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846>\
**Category:** Elasticsearch\
**Created:** [October 25, 2016, 8:41am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846 "2016-10-25T08:41:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kay\_kay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_kay/32/1470_2.png) [@kay\_kay](https://discuss.elastic.co/u/kay_kay)\
**Post date:** [October 25, 2016, 8:41am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/1 "2016-10-25T08:41:15Z")

</div>

It is similar to the [http://stackoverflow.com/questions/25135869/how-to-rebalance-shard-elasticsearch](http://stackoverflow.com/questions/25135869/how-to-rebalance-shard-elasticsearch) question.

Let's assume I have 5 ES data nodes, 11 indexes with replica=2. When I add an extra data node it remains empty. Is there a way to automatically rebalance all shards and fill in 6th node effectively?

I didn't find any proper answer except creating your own script which will calculate weights, amount of nodes and run `_cluster/reroute` on its own. I believe there should be possibility to rebalance cluster without 3rd party scripts.

---

<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:** [October 25, 2016, 8:42am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/2 "2016-10-25T08:42:55Z")

</div>

The only reason it would do that is if allocation has been disabled.  
Did you check cluster settings?

---

<div class="post-metadata">

**Author:** ![kay\_kay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_kay/32/1470_2.png) [@kay\_kay](https://discuss.elastic.co/u/kay_kay)\
**Post date:** [October 25, 2016, 8:44am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/3 "2016-10-25T08:44:39Z")

</div>

cluster.routing.rebalance.enable set to all

---

<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:** [October 25, 2016, 8:44am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/4 "2016-10-25T08:44:55Z")

</div>

What else is in cluster settings, there's nothing in there or....?

---

<div class="post-metadata">

**Author:** ![kay\_kay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_kay/32/1470_2.png) [@kay\_kay](https://discuss.elastic.co/u/kay_kay)\
**Post date:** [October 25, 2016, 8:47am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/5 "2016-10-25T08:47:43Z")

</div>

thanks. my bad. didn't notice  
"exclude" : {  
"\_host" : "10.1.57.8"  
}

---

<div class="post-metadata">

**Author:** ![kay\_kay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_kay/32/1470_2.png) [@kay\_kay](https://discuss.elastic.co/u/kay_kay)\
**Post date:** [October 25, 2016, 8:52am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/6 "2016-10-25T08:52:09Z")

</div>

Quick question, how to remove exclude properly? Set it to an empty string?

---

<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:** [October 25, 2016, 9:04am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/7 "2016-10-25T09:04:28Z")

</div>

Yeah, you can't remove a setting in \<5.0 unfortunately ☹  
Well you can, but needs a restart.

---

<div class="post-metadata">

**Author:** ![kay\_kay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_kay/32/1470_2.png) [@kay\_kay](https://discuss.elastic.co/u/kay_kay)\
**Post date:** [October 25, 2016, 9:05am UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/8 "2016-10-25T09:05:56Z")

</div>

thanks a lot.

---

<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 5, 2017, 10:10pm UTC](https://discuss.elastic.co/t/force-shards-rebalance-when-new-empty-node-has-joined/63846/9 "2017-07-05T22:10:06Z")

</div>


