# Deleting unassigned shard replicas

**URL:** <https://discuss.elastic.co/t/deleting-unassigned-shard-replicas/233896>\
**Category:** Elasticsearch\
**Created:** [May 22, 2020, 11:36am UTC](https://discuss.elastic.co/t/deleting-unassigned-shard-replicas/233896 "2020-05-22T11:36:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivierwa](https://avatars.discourse-cdn.com/v4/letter/o/aeb1de/32.png) [@olivierwa](https://discuss.elastic.co/u/olivierwa)\
**Post date:** [May 22, 2020, 11:36am UTC](https://discuss.elastic.co/t/deleting-unassigned-shard-replicas/233896/1 "2020-05-22T11:36:33Z")

</div>

I have a 3 node cluster (i2a, i2b and i2c) with a replica factor of 2 (1 primary, 2 copies). We noticed the cluster became yellow, as we have UNASSIGNED shards. Reason is that a copy of the share already exists.  
When we look at the shard status, we see the following:

```auto
tag-mapping-2.0 9 r STARTED 19 586.8kb node-master-i2b
tag-mapping-2.0 9 p STARTED 19 707.7kb node-master-i2a
tag-mapping-2.0 9 r STARTED 19 586.8kb node-master-i2c
tag-mapping-2.0 9 r UNASSIGNED

```

We see the same pattern for all the shards: 1 primary, 2 replicas and 1 unassigned.  
It seems that we just want to delete the unassigned shard.

I searched online but could not find a way to do this. We tried to restart each service, we tried to close/open the index, but the situation is still the same. We would prefer avoiding adding another node so the unassigned shard gets allocated to it.

What's the recommended way of proceeding? How could we just tell Elastic to ignore this unassigned replica so we can go back to a green state?

Thank you

---

<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:** [May 23, 2020, 8:47pm UTC](https://discuss.elastic.co/t/deleting-unassigned-shard-replicas/233896/2 "2020-05-23T20:47:40Z")

</div>

What are the index settings? Is it possible that you have number of replica shards set to 3?

---

<div class="post-metadata">

**Author:** ![olivierwa](https://avatars.discourse-cdn.com/v4/letter/o/aeb1de/32.png) [@olivierwa](https://discuss.elastic.co/u/olivierwa)\
**Post date:** [May 24, 2020, 5:57am UTC](https://discuss.elastic.co/t/deleting-unassigned-shard-replicas/233896/3 "2020-05-24T05:57:32Z")

</div>

Thank you for your help. The number of replicas is set to 2 (1 primary, 2 replicas)

---

<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:** [May 24, 2020, 6:20am UTC](https://discuss.elastic.co/t/deleting-unassigned-shard-replicas/233896/4 "2020-05-24T06:20:10Z")

</div>

Just to be sure can you please share the full output of `GET tag-mapping-2.0/_settings`? It would also be useful to see the output of `GET _cat/shards` for this index and run the [cluster allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html) on the unassigned shard.

---

<div class="post-metadata">

**Author:** ![olivierwa](https://avatars.discourse-cdn.com/v4/letter/o/aeb1de/32.png) [@olivierwa](https://discuss.elastic.co/u/olivierwa)\
**Post date:** [May 25, 2020, 11:37am UTC](https://discuss.elastic.co/t/deleting-unassigned-shard-replicas/233896/5 "2020-05-25T11:37:46Z")

</div>

You were so right! I used the command you provided to pull the index settings and indeed the replica was set to 3. My mistake for not checking.  
Thank you very much for your help.

---

<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 22, 2020, 11:37am UTC](https://discuss.elastic.co/t/deleting-unassigned-shard-replicas/233896/6 "2020-06-22T11:37:51Z")

</div>

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