# Unassigned shards when replica count updated to 0

**URL:** <https://discuss.elastic.co/t/unassigned-shards-when-replica-count-updated-to-0/83054>\
**Category:** Elasticsearch\
**Created:** [April 20, 2017, 12:29pm UTC](https://discuss.elastic.co/t/unassigned-shards-when-replica-count-updated-to-0/83054 "2017-04-20T12:29:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bneelima84](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bneelima84/32/28009_2.png) [@bneelima84](https://discuss.elastic.co/u/bneelima84)\
**Post date:** [April 20, 2017, 12:29pm UTC](https://discuss.elastic.co/t/unassigned-shards-when-replica-count-updated-to-0/83054/1 "2017-04-20T12:29:11Z")

</div>

We are using ES 2.4.0. We are noticing un-assigned shards in the below scenario:

1. Have 3 nodes designated as data nodes. (4 indexes with only 1 shard for each index)
2. Replica count set as 2 --\> Cluster state GREEN
3. Bring down 1 of the node
4. Replica count set as 1 --\> Cluster state GREEN
5. Bring down another node (Left with only one "data" node)
6. Replica count set as 0 --\> Cluster state RED

During Step 6, noticed that we get a cluster state as RED for those indices for which primary shard was the node that went down. (If we had all primary shards allocated to the node that was left in the cluster, we don't see an issue)

We have "cluster.routing.allocation.enable" set to "ALL". Anything else, we are missing due to which the shards are not being allocated to the only node thats left ?

---

<div class="post-metadata">

**Author:** ![bneelima84](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bneelima84/32/28009_2.png) [@bneelima84](https://discuss.elastic.co/u/bneelima84)\
**Post date:** [April 24, 2017, 8:47am UTC](https://discuss.elastic.co/t/unassigned-shards-when-replica-count-updated-to-0/83054/2 "2017-04-24T08:47:56Z")

</div>

The issue was due to updating the replica count to 0 before the node goes down. If we shutdown the node and then update the replica count to 0, it works fine.

---

<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:** [May 22, 2017, 8:56am UTC](https://discuss.elastic.co/t/unassigned-shards-when-replica-count-updated-to-0/83054/3 "2017-05-22T08:56:36Z")

</div>

Closed on May 22, 2017, 8:56am UTC

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