# How to recover unassigned shards and replica for a index

**URL:** https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917
**Category:** Elasticsearch
**Created:** [July 28, 2020, 2:01pm UTC](https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917 "2020-07-28T14:01:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)
#### Post date: [July 28, 2020, 2:01pm UTC](https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917/1 "2020-07-28T14:01:05Z")

</div>

HI team,  
I want to know how to recover the red state into Green and when it try to find the reason and im getting below data,

> xx-logstash-2020.07 0 p INITIALIZING INDEX\_REOPENED  
> xx-logstash-2020.07 0 r UNASSIGNED INDEX\_REOPENED  
> xx-logstash-2020.07 0 r UNASSIGNED INDEX\_REOPENED

I dont want to loss any data on that index.

How to recover without losing any information.

---

<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: [July 28, 2020, 8:11pm UTC](https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917/2 "2020-07-28T20:11:58Z")

</div>

As it is initializing I guess you will need to wait. How many indices and shards do you have in the cluster? How did the cluster end up in this state?

---

<div class="post-metadata">

### Author: ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)
#### Post date: [July 29, 2020, 1:28pm UTC](https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917/3 "2020-07-29T13:28:47Z")

</div>

@Christian_Dahlqvist thanks for the reply, Due to disk 100% per Utilization it end up this state.

My cluster detail below,

> {  
> "cluster\_name": "xxxxx",  
> "status": "red",  
> "timed\_out": false,  
> "number\_of\_nodes": 8,  
> "number\_of\_data\_nodes": 3,  
> "active\_primary\_shards": 82,  
> "active\_shards": 179,  
> "relocating\_shards": 0,  
> "initializing\_shards": 1,  
> "unassigned\_shards": 2,  
> "delayed\_unassigned\_shards": 0,  
> "number\_of\_pending\_tasks": 0,  
> "number\_of\_in\_flight\_fetch": 0,  
> "task\_max\_waiting\_in\_queue\_millis": 0,  
> "active\_shards\_percent\_as\_number": 98.35164835164835  
> }

---

<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: [July 29, 2020, 1:37pm UTC](https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917/4 "2020-07-29T13:37:46Z")

</div>

Reduce the number of replicas to 1 for any indices with a higher number configured in order to save space. Then delete data if needed.

---

<div class="post-metadata">

### Author: ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)
#### Post date: [July 29, 2020, 1:42pm UTC](https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917/5 "2020-07-29T13:42:34Z")

</div>

will it help to reduce my replica for that index,

PUT xxlogstash-2020.07/\_settings  
{  
"index" : {  
"number\_of\_replicas" : 0  
}  
}

---

<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: [July 29, 2020, 5:46pm UTC](https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917/6 "2020-07-29T17:46:54Z")

</div>

If you are lacking space I think you will need to do it for other indices that are already allocated in order to free up space.

---

<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: [August 26, 2020, 5:46pm UTC](https://discuss.elastic.co/t/how-to-recover-unassigned-shards-and-replica-for-a-index/242917/7 "2020-08-26T17:46:56Z")

</div>

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