# All shards remain unassigned after closing/opening an index with more than 1 replica on a single node cluster

**URL:** <https://discuss.elastic.co/t/all-shards-remain-unassigned-after-closing-opening-an-index-with-more-than-1-replica-on-a-single-node-cluster/69046>\
**Category:** Elasticsearch\
**Created:** [December 14, 2016, 4:12pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned-after-closing-opening-an-index-with-more-than-1-replica-on-a-single-node-cluster/69046 "2016-12-14T16:12:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![haizaar](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@haizaar](https://discuss.elastic.co/u/haizaar)\
**Post date:** [December 14, 2016, 4:12pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned-after-closing-opening-an-index-with-more-than-1-replica-on-a-single-node-cluster/69046/1 "2016-12-14T16:12:54Z")

</div>

I'm running ES 2.4.3 as a single node on my laptop.

I'm creating an index with number\_of\_replicas \>= 2. Then I close the index and open it again. After opening, all shards remain unassigned (and cluster becomes red).

Why is this happening? If I create index with number\_of\_replicas=1, it all works fine.

Reproduction:

```auto
$ curl -XPUT 'http://localhost:9200/foo/?pretty' -d '{ "settings": {"index": {"number_of_replicas": 2}}}'
{
  "acknowledged" : true
}

$ curl localhost:9200/_cluster/health/foo?pretty
{
  "cluster_name" : "elasticsearch",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 5,
  "active_shards" : 5,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 10,
  "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" : 47.45762711864407
}
$ curl -XPOST localhost:9200/foo/_close?pretty
{
  "acknowledged" : true
}
$ curl -XPOST localhost:9200/foo/_open?pretty
{
  "acknowledged" : true
}
$ curl localhost:9200/_cluster/health/foo?pretty
{
  "cluster_name" : "elasticsearch",
  "status" : "red",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 15,
  "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" : 38.983050847457626
}

```

Note that the cluster is Red and all `foo` shards are unassigned.

---

<div class="post-metadata">

**Author:** ![haizaar](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@haizaar](https://discuss.elastic.co/u/haizaar)\
**Post date:** [December 20, 2016, 12:42pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned-after-closing-opening-an-index-with-more-than-1-replica-on-a-single-node-cluster/69046/2 "2016-12-20T12:42:56Z")

</div>

Bump...

---

<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:** [January 17, 2017, 12:43pm UTC](https://discuss.elastic.co/t/all-shards-remain-unassigned-after-closing-opening-an-index-with-more-than-1-replica-on-a-single-node-cluster/69046/3 "2017-01-17T12:43:18Z")

</div>

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