# One Index is not recovering from the state INITIALIZING and UNASSIGNED

**URL:** https://discuss.elastic.co/t/one-index-is-not-recovering-from-the-state-initializing-and-unassigned/286468
**Category:** Elasticsearch
**Created:** [October 12, 2021, 10:17am UTC](https://discuss.elastic.co/t/one-index-is-not-recovering-from-the-state-initializing-and-unassigned/286468 "2021-10-12T10:17:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Programmer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/programmer/32/95735_2.png) [@Programmer](https://discuss.elastic.co/u/Programmer)
#### Post date: [October 12, 2021, 10:17am UTC](https://discuss.elastic.co/t/one-index-is-not-recovering-from-the-state-initializing-and-unassigned/286468/1 "2021-10-12T10:17:23Z")

</div>

```auto
curl -XGET http://localhost:9200/_cat/shards

app-all 1 r INITIALIZING 172.16.4.165 viepevrat02
app-all 1 p STARTED 85125705 67gb 172.16.4.164 viepevrat01
app-all 0 p RELOCATING 85129005 67.2gb 172.16.4.164 viepevrat01 -> 172.16.4.165 qkcdvYPDTNSc5jmMa6_uFw viepevrat02
app-all 0 r UNASSIGNED

Previously , the state of app-all in 172.16.4.165 was INITIALIZING , but after reading some resolution method to make the cluster to green, I used the below api to make the replica 0 and once it turned green I made it 1 back. Now getting the above status.

curl -XPUT 'localhost:9200/app-all/_settings' -d '
{
    "index" : {
        "number_of_replicas" : 0
   }
}

```

---

<div class="post-metadata">

### Author: ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)
#### Post date: [October 12, 2021, 8:40pm UTC](https://discuss.elastic.co/t/one-index-is-not-recovering-from-the-state-initializing-and-unassigned/286468/2 "2021-10-12T20:40:13Z")

</div>

When your cluster is under going recovery/rebalancing, it's possible to have unassigned replica shards. There are cluster settings that allow you to increase the max number of nodes, files that can be "moved" at any given time. So you could potentially increase those settings to kick start the shard assignment.  
But if there's a new index being created, you will have unassigned shard again until one of the existing tasks is done.  
So it's just the recovery task queue wait time you are seeing.  
I personally would just wait for the rebalancing to complete. The unassigned shard will be handled properly next.

If you have no rebalancing going on while having unassigned shards, then you might need to issue "reroute" command to assign the shards manually. That usually means the shard assignment has tried and failed too many times for some reason.

---

<div class="post-metadata">

### Author: ![zx8086](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zx8086/32/94917_2.png) [@zx8086](https://discuss.elastic.co/u/zx8086)
#### Post date: [October 12, 2021, 10:14pm UTC](https://discuss.elastic.co/t/one-index-is-not-recovering-from-the-state-initializing-and-unassigned/286468/3 "2021-10-12T22:14:35Z")

</div>

> [@Programmer](#):
>
> `"number_of_replicas" : 0`

Does the template for that index exist and have you set the replicas to 0?

---

<div class="post-metadata">

### Author: ![Programmer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/programmer/32/95735_2.png) [@Programmer](https://discuss.elastic.co/u/Programmer)
#### Post date: [October 13, 2021, 12:45pm UTC](https://discuss.elastic.co/t/one-index-is-not-recovering-from-the-state-initializing-and-unassigned/286468/4 "2021-10-13T12:45:15Z")

</div>

You are correct. Now I could see the index 'app-all' in one node is still under INITIALIZING Stage and recovery files are getting created which consumes more memory. But in the other node when I checked the health it is started and working as expected. What I did now I just changed the number of replicas to 0 for that particular index. Now the replica shards seems deleted, where the autogenerated recovery files were created . I will try with the reroute command to assign the shards manually. Thanks for the reply

---

<div class="post-metadata">

### Author: ![Programmer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/programmer/32/95735_2.png) [@Programmer](https://discuss.elastic.co/u/Programmer)
#### Post date: [October 13, 2021, 12:46pm UTC](https://discuss.elastic.co/t/one-index-is-not-recovering-from-the-state-initializing-and-unassigned/286468/5 "2021-10-13T12:46:21Z")

</div>

No the replica shards has been deleted when I changed the replica number to 0

---

<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: [November 10, 2021, 12:46pm UTC](https://discuss.elastic.co/t/one-index-is-not-recovering-from-the-state-initializing-and-unassigned/286468/6 "2021-11-10T12:46:57Z")

</div>

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