# Unassigned shards cluster\_recovered

**URL:** https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755
**Category:** Elasticsearch
**Created:** [March 11, 2019, 12:24pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755 "2019-03-11T12:24:26Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 11, 2019, 12:24pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/1 "2019-03-11T12:24:27Z")

</div>

unassigned shards cluster\_recovered

i am using elasticsearch 6.1

i have each indices

number\_of\_shards : 2  
number\_of\_replicas : 3

i have checked the memory and storege everything look ok

---

<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: [March 11, 2019, 1:24pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/2 "2019-03-11T13:24:52Z")

</div>

The [allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/cluster-allocation-explain.html) should be the first thing you try if you want to explain why some shards are unassigned. If you need help interpreting the output please copy it here.

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 11, 2019, 1:27pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/3 "2019-03-11T13:27:07Z")

</div>

curl -XGET '[http://localhost:9200/\_cluster/allocation/explain?pretty](http://localhost:9200/_cluster/allocation/explain?pretty)'  
{  
"index" : "25bdefghjklmprty\_store\_1",  
"shard" : 2,  
"primary" : false,  
"current\_state" : "unassigned",  
"unassigned\_info" : {  
"reason" : "CLUSTER\_RECOVERED",  
"at" : "2019-03-11T13:15:29.449Z",  
"last\_allocation\_status" : "no\_attempt"  
},  
"can\_allocate" : "no",  
"allocate\_explanation" : "cannot allocate because allocation is not permitted to any of the nodes",  
"node\_allocation\_decisions" : [  
{  
"node\_id" : "3chymNCZQU6TB6Aegev0bA",  
"node\_name" : "node\_1",  
"transport\_address" : "127.0.0.1:9300",  
"node\_decision" : "no",  
"deciders" : [  
{  
"decider" : "filter",  
"decision" : "NO",  
"explanation" : "node does not match index setting [index.routing.allocation.include] filters [rack:"node\_16",\_name:"node\_16",size:"big"]"  
}  
]  
},  
{  
"node\_id" : "XLkUsRd3RfSpSt1pEI774Q",  
"node\_name" : "node\_16",  
"transport\_address" : "127.0.0.1:9301",  
"node\_attributes" : {  
"size" : "big",  
"rack" : "node\_16"  
},  
"node\_decision" : "no",  
"deciders" : [  
{  
"decider" : "same\_shard",  
"decision" : "NO",  
"explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[25bdefghjklmprty\_store\_1][2], node[XLkUsRd3RfSpSt1pEI774Q], [P], s[STARTED], a[id=YZaIAVK2SrWLQsHhT2QdoA]]"  
}  
]  
}  
]  
}

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 15, 2019, 4:13am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/4 "2019-03-15T04:13:37Z")

</div>

Hello

i am waiting for your reply

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 15, 2019, 6:25am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/5 "2019-03-15T06:25:38Z")

</div>

It looks like you are using shard allocation filtering/awareness. If so, how is this configured? How many nodes do you have in the cluster? How are these tagged with attributes?

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 15, 2019, 7:20am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/6 "2019-03-15T07:20:30Z")

</div>

> [@pjayramkumar](#):
>
> node\_16

Hello there are many nodes in the server and it configure using the tagged and attribute with name of the node

like node\_16 and size: big etc

---

<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: [March 15, 2019, 8:00am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/7 "2019-03-15T08:00:44Z")

</div>

> [@pjayramkumar](#):
>
> `[index.routing.allocation.include] filters [rack:"node_16",_name:"node_16",size:"big"`

This looks wrong. You have a shard allocation filter which wants to allocate this shard to a node in a rack called `node_16`. That's a strange name for a rack. I think this is a mistake.

Also you're trying to allocate this shard to a node whose _name_ is `node_16`. That has worked, `node_16` has the primary of this shard, but the replica cannot be allocated because there's no other node called `node_16`.

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 15, 2019, 8:21am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/8 "2019-03-15T08:21:12Z")

</div>

Hello

i think rack is fine because i am creating a rack for each node so each node have it's own rack

node\_16 is node that available because other indices are there and working fine

---

<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: [March 15, 2019, 8:22am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/9 "2019-03-15T08:22:31Z")

</div>

> [@pjayramkumar](#):
>
> node\_16 is node that available because other indices are there and working fine

Sure, but you can't allocate the primary _and_ the replica to node 16:

> `"explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[25bdefghjklmprty_store_1][2], node[XLkUsRd3RfSpSt1pEI774Q], [P], s[STARTED], a[id=YZaIAVK2SrWLQsHhT2QdoA]]"`

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 15, 2019, 8:23am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/10 "2019-03-15T08:23:53Z")

</div>

hello actualy this is question that i am asking to 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: [March 15, 2019, 8:28am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/11 "2019-03-15T08:28:40Z")

</div>

I do not understand the question. You seem to be asking why the replica is unassigned. It's unassigned because you have instructed Elasticsearch to allocate all shard copies to the same node, but it doesn't make sense to allocate more than one copy to each node, so Elasticsearch is leaving the replica unassigned.

You can fix this by:

1. removing this filter so that Elasticsearch can assign the replicas elsewhere, or
2. removing the replica by setting `"number_of_replicas": 0` on this index

Perhaps I'm misunderstanding you. If so, can you explain at length what you're trying to do and what you're expecting to happen with this configuration.

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 15, 2019, 9:18am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/12 "2019-03-15T09:18:00Z")

</div>

Hello

i want to have many node and i want to keep the

primary : 2  
replica : 5

so my node never fail to deliver the result

what configiration i need to manage this?

---

<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: [March 15, 2019, 12:31pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/13 "2019-03-15T12:31:46Z")

</div>

> [@pjayramkumar](#):
>
> what configiration i need to manage this?

Just remove the allocation filters and let Elasticsearch decide where to allocate the shards itself.

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 15, 2019, 12:51pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/14 "2019-03-15T12:51:33Z")

</div>

so i have to remove all three filters

\_name , rack and size ?

---

<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: [March 15, 2019, 1:00pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/15 "2019-03-15T13:00:26Z")

</div>

Maybe you can leave the `size` one, I don't know, it depends on many details of your cluster that you have not shared. But the `node` and `rack` ones definitely look wrong to me.

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 15, 2019, 1:12pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/16 "2019-03-15T13:12:06Z")

</div>

> [@DavidTurner](#):
>
> `node`

do you means \_name ?

---

<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: [March 15, 2019, 1:21pm UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/17 "2019-03-15T13:21:06Z")

</div>

Yes, sorry, I meant `_name`.

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 19, 2019, 6:46am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/18 "2019-03-19T06:46:31Z")

</div>

> [@pjayramkumar](#):
>
> rack:"node\_16",\_name:"node\_16",

Hello

these setting allow indices to assign on specific place

but if we remove this then it can be assing anywhere

so what if it assing to some randome node and then we delete the node so we have data lose

correct me if i am wrong

---

<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: [March 19, 2019, 9:30am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/19 "2019-03-19T09:30:57Z")

</div>

It's correct that Elasticsearch will choose where to assign the shards of this index, but it is not correct that losing a node will lead to data loss. Elasticsearch will make sure that there is a replica on a different node that can take over if necessary.

---

<div class="post-metadata">

### Author: ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)
#### Post date: [March 19, 2019, 11:56am UTC](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755/20 "2019-03-19T11:56:20Z")

</div>

What is method to delete the node that follow as you explain

[Next page](https://discuss.elastic.co/t/unassigned-shards-cluster-recovered/171755.md?page=2)
