# Using /\_cluster/settings -\> cluster.routing.allocation.exclude works for only one node?

**URL:** https://discuss.elastic.co/t/using-cluster-settings-cluster-routing-allocation-exclude-works-for-only-one-node/179224
**Category:** Elasticsearch
**Created:** [May 1, 2019, 3:45pm UTC](https://discuss.elastic.co/t/using-cluster-settings-cluster-routing-allocation-exclude-works-for-only-one-node/179224 "2019-05-01T15:45:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![preddy75](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@preddy75](https://discuss.elastic.co/u/preddy75)
#### Post date: [May 1, 2019, 3:45pm UTC](https://discuss.elastic.co/t/using-cluster-settings-cluster-routing-allocation-exclude-works-for-only-one-node/179224/1 "2019-05-01T15:45:45Z")

</div>

Hi,

I am running ELK on large Kubernetes environment, and it is common case to bring nodes in and out of environment. Right now we have mixed sized disks and need to route away from small nodes to large nodes.

I am issuing:

PUT /\_cluster/settings  
{  
"transient": {  
"cluster.routing.allocation.exclude.\_name": "node-1"  
}  
}

I come back later and "node-1" is drained down to 1 shard (searchguard). I want to take out another node as well before scaling down my Elasticsearch statefulset to permanently pull these two nodes out.

However after I issued:

PUT /\_cluster/settings  
{  
"transient": {  
"cluster.routing.allocation.exclude.\_name": "node-2"  
}  
}

I noticed "node-1" was no longer in my settings (which now that I am looking at rest of API makes sense)

{  
"persistent": {  
"cluster": {  
"routing": {  
"allocation": {  
"cluster\_concurrent\_rebalance": "16",  
"node\_concurrent\_recoveries": "4",  
"node\_initial\_primaries\_recoveries": "8",  
"enable": "all"  
}  
}  
}  
},  
"transient": {  
"cluster": {  
"routing": {  
"allocation": {  
"exclude": {  
"\_name": "node-2"  
}  
}  
}  
}  
}  
}

So of course when I came back the next day, node-1 was full again, and node-2 was drained down to searchguard.

I see in the documentation that you all a "\*" in the node name, but that won't allow me to accomplish what I want, keeping "node-1", and "node-2" in drained state and not being routed to before I shutdown ES.

Namely,  
[https://www.elastic.co/guide/en/elasticsearch/reference/5.6/allocation-filtering.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/allocation-filtering.html)

Is there a way to specify more than one node without using just \*?

---

<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: [May 1, 2019, 9:22pm UTC](https://discuss.elastic.co/t/using-cluster-settings-cluster-routing-allocation-exclude-works-for-only-one-node/179224/2 "2019-05-01T21:22:23Z")

</div>

Yes, you can use a comma-separated list of node names:

```auto
PUT /_cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.exclude._name":"node-1,node-2"
  }
}

```

---

<div class="post-metadata">

### Author: ![preddy75](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@preddy75](https://discuss.elastic.co/u/preddy75)
#### Post date: [May 4, 2019, 2:31pm UTC](https://discuss.elastic.co/t/using-cluster-settings-cluster-routing-allocation-exclude-works-for-only-one-node/179224/3 "2019-05-04T14:31:08Z")

</div>

Thank you. Works.

---

<div class="post-metadata">

### Author: ![preddy75](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@preddy75](https://discuss.elastic.co/u/preddy75)
#### Post date: [May 4, 2019, 2:32pm UTC](https://discuss.elastic.co/t/using-cluster-settings-cluster-routing-allocation-exclude-works-for-only-one-node/179224/4 "2019-05-04T14:32:14Z")

</div>

And btw, for those running in env's that have nodes restart from time to time, make sure its persistent (like solution says).

---

<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: [June 1, 2019, 2:44pm UTC](https://discuss.elastic.co/t/using-cluster-settings-cluster-routing-allocation-exclude-works-for-only-one-node/179224/5 "2019-06-01T14:44:48Z")

</div>

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