# Cluster.routing.allocation.exclude.\_name not working

**URL:** <https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620>\
**Category:** Elasticsearch\
**Created:** [December 12, 2018, 8:56pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620 "2018-12-12T20:56:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![philschroeder](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@philschroeder](https://discuss.elastic.co/u/philschroeder)\
**Post date:** [December 12, 2018, 8:56pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620/1 "2018-12-12T20:56:05Z")

</div>

Hi,

I am trying to decommission some nodes in an old (ES2.2) cluster. First step is moving the data off of the nodes. I'm using:

> ```
> curl -XPUT ES_HOST:9200/_cluster/settings?explain -H 'Content-Type: application/json' -d '{
> "transient" :{
> "cluster.routing.allocation.exclude._name" : "ES_NODENAME"
> }
> }'
> 
> ```

And I get the typical ack:

`> {"acknowledged":true,"persistent":{},"transient":{"cluster":{"routing":{"allocation":{"exclude":{"_name":"ES_NODENAME"}}}}}}`

However, shards do not start relocating like I'd expect. Nothing happens. I check the cluster settings, and see what I've issued:

```
> curl -XGET 'http://ES_HOST:9200/_cluster/settings?pretty'
> {
> "persistent" : {
> "threadpool" : {
> "search" : {
> "queue_size" : "10000"
> }
> }
> },
> "transient" : {
> "cluster" : {
> "routing" : {
> "allocation" : {
> "cluster_concurrent_rebalance" : "-1",
> "exclude" : {
> "_name" : "ES_NODENAME"
> }
> }
> }
> }
> }
> }

```

At this point I'm at a loss. There's nothing in the logs regarding this. Anyone have any suggestions?

---

<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:** [December 12, 2018, 10:06pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620/2 "2018-12-12T22:06:57Z")

</div>

> [@philschroeder](#):
>
> Anyone have any suggestions?

This all looks in order, except that I guess you've redacted the node name. The first thing I would do is to triple-check that this is correct (vs the node name reported by `GET /`). Get someone else to look at it if possible.

The next thing I'd suspect is that the shards are staying on this node because they can't be reallocated elsewhere for some other reason. Try creating a new index with a single shard and enough replicas to give one shard copy to every node in your cluster. If all of the new shards are allocated then I'm stumped, but if it prefers not to allocate a copy to the excluded node then the exclusion is working and there's some other reason for nothing happening.

---

<div class="post-metadata">

**Author:** ![philschroeder](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@philschroeder](https://discuss.elastic.co/u/philschroeder)\
**Post date:** [December 12, 2018, 10:25pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620/3 "2018-12-12T22:25:17Z")

</div>

Thanks David. I did redact the node name (elasticsearch14a). I thought that might the issue as well, but I made sure the node shows up in `/_cat/nodes`, and checked `GET /` like you suggested, and spelling is right and all.

---

<div class="post-metadata">

**Author:** ![philschroeder](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@philschroeder](https://discuss.elastic.co/u/philschroeder)\
**Post date:** [December 12, 2018, 10:38pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620/4 "2018-12-12T22:38:51Z")

</div>

I created a test\_index index with one shard and 23 replicas (this is a 24 node cluster). I see that I have one unassigned shard, with the excluded node being the one that doesn't have a replica:

```
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch03a
test_index 0 p STARTED 0 159b 10.X.X.X elasticsearch09a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch10b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch07a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch04b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch05a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch04a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch11b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch02a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch11a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch06a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch03b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch10a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch13a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch07b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch13b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch14a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch05b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch08a
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch09b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch08b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch02b
test_index 0 r STARTED 0 159b 10.X.X.X elasticsearch06b
test_index 0 r UNASSIGNED

```

So it appears that the 'disable allocation' is working, but perhaps something else is stopping data from moving off of the node. I'm somewhat green regarding ES administration...what are my next steps?

---

<div class="post-metadata">

**Author:** ![philschroeder](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@philschroeder](https://discuss.elastic.co/u/philschroeder)\
**Post date:** [December 13, 2018, 1:07am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620/5 "2018-12-13T01:07:58Z")

</div>

Think I have figured out the issue. I tried rerouting a single shard from the excluded node to another, and got this inside of the response:

`[NO(too many shards for this index [sessions-17w29] on node [1], limit: [1])]`

Someone set these indexes to have 24 shards, and now that we're down to 24 nodes, I will need to set total\_shards\_per\_node to something higher than 1. Sounds like I need to do a little research into what the I/O hit will be.

---

<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:** [December 13, 2018, 8:46am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620/6 "2018-12-13T08:46:03Z")

</div>

> [@philschroeder](#):
>
> Think I have figured out the issue. I tried rerouting a single shard from the excluded node to another, and got this inside of the response:

Yes, that'd explain it. Great work.

---

<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:** [January 10, 2019, 8:46am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-exclude-name-not-working/160620/7 "2019-01-10T08:46:05Z")

</div>

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