# Switching 'cluster.routing.allocation' between node-upgrades

**URL:** https://discuss.elastic.co/t/switching-cluster-routing-allocation-between-node-upgrades/335843
**Category:** Elasticsearch
**Created:** [June 13, 2023, 8:56am UTC](https://discuss.elastic.co/t/switching-cluster-routing-allocation-between-node-upgrades/335843 "2023-06-13T08:56:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![slash24](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@slash24](https://discuss.elastic.co/u/slash24)
#### Post date: [June 13, 2023, 8:56am UTC](https://discuss.elastic.co/t/switching-cluster-routing-allocation-between-node-upgrades/335843/1 "2023-06-13T08:56:06Z")

</div>

We have a three-node cluster onprem, and during rolling upgrade of the individual Elastic-nodes, we tend to toggle 'cluster.routing.allocation.enable' between 'primaries' and null.  
Is this necessary to do between each individual node upgrade, or is it enough to set the it to 'primaries' before the upgrade and then back to null after all three nodes are done and online?

If it is: Is it crucial to wait for unsassigned shards to reach 0 before setting .enable to 'primaries' and upgrade the next node?

It takes a noticable time for 'unassigned shards' to reach 0, so it'd be time efficent to just play the wait-game once.

---

<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: [June 20, 2023, 4:26am UTC](https://discuss.elastic.co/t/switching-cluster-routing-allocation-between-node-upgrades/335843/2 "2023-06-20T04:26:49Z")

</div>

Part of that might come down to if you are using [delayed allocation](https://www.elastic.co/guide/en/elasticsearch/reference/8.8/delayed-allocation.html). If you aren't - or your restart takes longer than the configured delay - then you will want to manage allocation and ensure that the primaries are allocated before you restart the next node. [Full-cluster restart and rolling restart | Elasticsearch Guide [8.8] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.8/restart-cluster.html#restart-cluster-rolling) goes into 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: [July 18, 2023, 4:27am UTC](https://discuss.elastic.co/t/switching-cluster-routing-allocation-between-node-upgrades/335843/3 "2023-07-18T04:27:17Z")

</div>

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