# Modify index.routing.allocation.total\_shards\_per\_node by ILM when going to WARM

**URL:** <https://discuss.elastic.co/t/modify-index-routing-allocation-total-shards-per-node-by-ilm-when-going-to-warm/282551>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [August 26, 2021, 8:59am UTC](https://discuss.elastic.co/t/modify-index-routing-allocation-total-shards-per-node-by-ilm-when-going-to-warm/282551 "2021-08-26T08:59:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petr.Simik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/petr.simik/32/38082_2.png) [@Petr.Simik](https://discuss.elastic.co/u/Petr.Simik)\
**Post date:** [August 26, 2021, 8:59am UTC](https://discuss.elastic.co/t/modify-index-routing-allocation-total-shards-per-node-by-ilm-when-going-to-warm/282551/1 "2021-08-26T08:59:13Z")

</div>

I have set "index.routing.allocation.total\_shards\_per\_node" :1 in index template  
for index with 6 primary shards. Because it is index intensive ETL and having shards on different nodes gives best performance results.  
However I have only 4 warm nodes.  
When index age moves shards to warm nodes it moves only 4 shards and 2 remains on hot nodes.  
Is it possible to set "index.routing.allocation.total\_shards\_per\_node" : null in ILM policy ?  
It there a different approach how to achieve this (other than adding 2 warm nodes )?

thank you

---

<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:** [August 26, 2021, 11:11am UTC](https://discuss.elastic.co/t/modify-index-routing-allocation-total-shards-per-node-by-ilm-when-going-to-warm/282551/2 "2021-08-26T11:11:02Z")

</div>

> [@Petr.Simik](#):
>
> Is it possible to set "index.routing.allocation.total\_shards\_per\_node" : null in ILM policy ?

It isn't today but it will be in 7.16:

> <https://github.com/elastic/elasticsearch/pull/76134>
>
> This adds a new optional field to the allocate ILM action called "total\_shards\_p…er\_node". If present, the value of this field
> is set as the value of "index.routing.allocation.total\_shards\_per\_node" before the allocation takes place.

---

<div class="post-metadata">

**Author:** ![Petr.Simik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/petr.simik/32/38082_2.png) [@Petr.Simik](https://discuss.elastic.co/u/Petr.Simik)\
**Post date:** [August 26, 2021, 12:37pm UTC](https://discuss.elastic.co/t/modify-index-routing-allocation-total-shards-per-node-by-ilm-when-going-to-warm/282551/3 "2021-08-26T12:37:46Z")

</div>

great thank you.  
I suppose I will use today as a workaround the"index.routing.allocation.total\_shards\_per\_node" : 2  
it will not perform as good as 1shard per node but it will shift all shards to warm nodes and resolve my problem.

---

<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:** [August 26, 2021, 12:53pm UTC](https://discuss.elastic.co/t/modify-index-routing-allocation-total-shards-per-node-by-ilm-when-going-to-warm/282551/4 "2021-08-26T12:53:45Z")

</div>

Sounds reasonable. Elasticsearch should be trying to spread the shards of the index out across the nodes anyway, but doesn't guarantee to do so without this setting.

If there's a period of time between rolling over and moving the data to the warm nodes (e.g. you retain N days of completed indices on the hot nodes) then you can write yourself a script to remove `index.routing.allocation.total_shards_per_node` once the index has rolled over. That's something that I've seen other folks do to work around this.

---

<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:** [September 23, 2021, 12:54pm UTC](https://discuss.elastic.co/t/modify-index-routing-allocation-total-shards-per-node-by-ilm-when-going-to-warm/282551/5 "2021-09-23T12:54:22Z")

</div>

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