# How to change from red to green

**URL:** https://discuss.elastic.co/t/how-to-change-from-red-to-green/49484
**Category:** Elasticsearch
**Created:** [May 8, 2016, 1:47pm UTC](https://discuss.elastic.co/t/how-to-change-from-red-to-green/49484 "2016-05-08T13:47:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kartikvelastic](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kartikvelastic](https://discuss.elastic.co/u/kartikvelastic)
#### Post date: [May 8, 2016, 1:47pm UTC](https://discuss.elastic.co/t/how-to-change-from-red-to-green/49484/1 "2016-05-08T13:47:53Z")

</div>

I am not sure what went wrong, kibana visualization works without issue, but here is the status of the cluster:

[http://pastebin.com/uvjSUdez](http://pastebin.com/uvjSUdez)

and

[http://pastebin.com/6DFZa2dh](http://pastebin.com/6DFZa2dh)

No errors in production.log on any of the data nodes. Restarted elasticsearch on data nodes without success.

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [May 8, 2016, 5:46pm UTC](https://discuss.elastic.co/t/how-to-change-from-red-to-green/49484/2 "2016-05-08T17:46:17Z")

</div>

> [@kartikvelastic](#):
>
> No errors in production.log on any of the data nodes. Restarted elasticsearch on data nodes without success.

There are 4 unassigned shards. You can probably find them with the [\_cat/shards](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html) api. I'm going to take a wild guess and say that at some point you lost the last primary copy of one of those shards. Elasticsearch can restore it because the data is just gone. This can happen if you create the index without any replicas and you lose a node. If you don't need the index you can just `curl -XDELETE localhost:9200/index_name` and it'll be gone for good. If you want to assign that shard you can use the [cluster reroute](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html) API with `allow_primary` set to true. That'll cause an empty shard to be created but it'll get the cluster green again. That is useful if you lost only a single shard in a multishard index and you want create it empty and just reindex all the data that needs to be in there.

---

<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: [July 5, 2017, 10:53pm UTC](https://discuss.elastic.co/t/how-to-change-from-red-to-green/49484/3 "2017-07-05T22:53:08Z")

</div>


