# How to assign correctly shards when a new node join cluster?

**URL:** <https://discuss.elastic.co/t/how-to-assign-correctly-shards-when-a-new-node-join-cluster/217436>\
**Category:** Elasticsearch\
**Created:** [January 31, 2020, 5:17pm UTC](https://discuss.elastic.co/t/how-to-assign-correctly-shards-when-a-new-node-join-cluster/217436 "2020-01-31T17:17:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [January 31, 2020, 5:17pm UTC](https://discuss.elastic.co/t/how-to-assign-correctly-shards-when-a-new-node-join-cluster/217436/1 "2020-01-31T17:17:23Z")

</div>

Hi,  
this is my current scenario:  
9 DATA nodes  
A lot of indices (avg size 5 GB and 3 shards and 2 replica)  
1 big index (100 GB size and 12 shards and 3 replica)

When a new DATA node joins the cluster, Elasticsearch will give to it a lot of shards; in a specific way, to reduce the gap of disk space and number of shards, it will assign almost 12 shards of my biggest index to this new node.  
Unfortunately, that index is the most used by my system so when this happens, my cluster will suffering of bad performance. For sure, when the balancing procedure is completed, my new DATA node will release some shards to the other nodes but this 2-steps will takes a lot of time.

Is there a way to say to Elastic to assign not all the shards to the new node but only 3 (since my total number is 12)? Or something similar....

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [January 31, 2020, 9:02pm UTC](https://discuss.elastic.co/t/how-to-assign-correctly-shards-when-a-new-node-join-cluster/217436/2 "2020-01-31T21:02:09Z")

</div>

You could use [disk-based shard allocation](https://www.elastic.co/guide/en/elasticsearch/reference/master/disk-allocator.html) to reduce the amount of data/shards that gets relocated. You could use [index-level shard allocation filtering](https://www.elastic.co/guide/en/elasticsearch/reference/master/shard-allocation-filtering.html#) to keep the big index's shards off of the new nodes.

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [January 31, 2020, 10:28pm UTC](https://discuss.elastic.co/t/how-to-assign-correctly-shards-when-a-new-node-join-cluster/217436/3 "2020-01-31T22:28:17Z")

</div>

Not really sure about allocation filtering. If a node loses network connectivity I cannot know before which one will be. I saw that I can also specify priority for each index.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 1, 2020, 6:54am UTC](https://discuss.elastic.co/t/how-to-assign-correctly-shards-when-a-new-node-join-cluster/217436/4 "2020-02-01T06:54:52Z")

</div>

> [@rschirin](#):
>
> Is there a way to say to Elastic to assign not all the shards to the new node but only 3 (since my total number is 12)? Or something similar....

Yes, there's a setting for that: [Total shards per node | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/allocation-total-shards.html)

---

<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:** [February 29, 2020, 6:54am UTC](https://discuss.elastic.co/t/how-to-assign-correctly-shards-when-a-new-node-join-cluster/217436/5 "2020-02-29T06:54:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
