# How to resolve elasticsearch status red

**URL:** <https://discuss.elastic.co/t/how-to-resolve-elasticsearch-status-red/14885>\
**Category:** Elasticsearch\
**Created:** [December 16, 2013, 10:48am UTC](https://discuss.elastic.co/t/how-to-resolve-elasticsearch-status-red/14885 "2013-12-16T10:48:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaoliang\_tian](https://avatars.discourse-cdn.com/v4/letter/x/a9a28c/32.png) [@xiaoliang\_tian](https://discuss.elastic.co/u/xiaoliang_tian)\
**Post date:** [December 16, 2013, 10:48am UTC](https://discuss.elastic.co/t/how-to-resolve-elasticsearch-status-red/14885/1 "2013-12-16T10:48:34Z")

</div>

I have one master 1 data and 1 search node,Then are running on AWS

During indexing ,cluster status became from green to red,and there is part  
of unassigned shards,I terminated the only data node by mistake,and start a  
new VM and let it join into cluster,It turns out status is still red and  
All of shards is unassigned.

1.is there any way to recover the status to green?  
2.is there any chance I can recovered the data node's data?because I  
terminated the only data node  
3.And if I met this situation again,I mean "During indexing ,cluster status  
became from green to red,and there is part of unassigned shards".How can I  
recover status to green

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bc9de699-59f6-46a9-8384-64a76878b03d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc9de699-59f6-46a9-8384-64a76878b03d%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jon\_Attree](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@Jon\_Attree](https://discuss.elastic.co/u/Jon_Attree)\
**Post date:** [December 16, 2013, 8:52pm UTC](https://discuss.elastic.co/t/how-to-resolve-elasticsearch-status-red/14885/2 "2013-12-16T20:52:57Z")

</div>

Had a similar issue. I managed to recover all my unassigned shards and get  
the cluster back to a green status using the following procedure. It could  
probably be streamlined but it works.

1. Dump list of unassigned shards to text file. Using the following command

curl -XGET [http://localhost:9200/\_cluster/state?pretty=true](http://localhost:9200/_cluster/state?pretty=true) \>\>  
/tmp/unassign.txt

1. VI unassign.txt

2. Search the file for UNASSIGNED

3. Running the following command on each unassigned shard

curl XPOST -s '[http://localhost:9200/\_cluster/reroute?pretty=true](http://localhost:9200/_cluster/reroute?pretty=true)' -d '{  
"commands" : [ { "allocate" : {

```
          "index" : "*INDEX TO WISH TO REASSIGN*", "shard" : 0 , "node" 

```

: "_NODE YOU WISH TO ASSIGN IT TO_", "allow\_primary" : 1 }

```
    }

]

```

}’  
If the shard is a number other than 0 change it to reflex that as well.

Good luck,

Jon

On Monday, December 16, 2013 2:48:34 AM UTC-8, xiaoliang tian wrote:

> I have one master 1 data and 1 search node,Then are running on AWS
> 
> During indexing ,cluster status became from green to red,and there is part  
> of unassigned shards,I terminated the only data node by mistake,and start a  
> new VM and let it join into cluster,It turns out status is still red and  
> All of shards is unassigned.
> 
> 1.is there any way to recover the status to green?  
> 2.is there any chance I can recovered the data node's data?because I  
> terminated the only data node  
> 3.And if I met this situation again,I mean "During indexing ,cluster  
> status became from green to red,and there is part of unassigned shards".How  
> can I recover status to green

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/acfe086c-32d0-47c9-aa2d-39f2ac58986d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/acfe086c-32d0-47c9-aa2d-39f2ac58986d%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![xiaoliang\_tian](https://avatars.discourse-cdn.com/v4/letter/x/a9a28c/32.png) [@xiaoliang\_tian](https://discuss.elastic.co/u/xiaoliang_tian)\
**Post date:** [December 17, 2013, 8:51am UTC](https://discuss.elastic.co/t/how-to-resolve-elasticsearch-status-red/14885/3 "2013-12-17T08:51:27Z")

</div>

this procedure is really great and helps a lot,thanks!

2013/12/17 Jon Attree [jattree@gmail.com](mailto:jattree@gmail.com)

> Had a similar issue. I managed to recover all my unassigned shards and get  
> the cluster back to a green status using the following procedure. It could  
> probably be streamlined but it works.
> 
> 1. Dump list of unassigned shards to text file. Using the following  
> command
> 
> curl -XGET [http://localhost:9200/\_cluster/state?pretty=true](http://localhost:9200/_cluster/state?pretty=true) \>\>  
> /tmp/unassign.txt
> 
> 1. VI unassign.txt
> 
> 2. Search the file for UNASSIGNED
> 
> 3. Running the following command on each unassigned shard
> 
> curl XPOST -s '[http://localhost:9200/\_cluster/reroute?pretty=true](http://localhost:9200/_cluster/reroute?pretty=true)' -d '{  
> "commands" : [ { "allocate" : {
> 
> ```
> "index" : "*INDEX TO WISH TO REASSIGN*", "shard" : 0 ,
> 
> ```
> 
> "node" : "_NODE YOU WISH TO ASSIGN IT TO_", "allow\_primary" : 1 }
> 
> ```
> }
> 
> ]
> 
> ```
> 
> }’  
> If the shard is a number other than 0 change it to reflex that as well.
> 
> Good luck,
> 
> Jon
> 
> On Monday, December 16, 2013 2:48:34 AM UTC-8, xiaoliang tian wrote:
> 
> > I have one master 1 data and 1 search node,Then are running on AWS
> > 
> > During indexing ,cluster status became from green to red,and there is  
> > part of unassigned shards,I terminated the only data node by mistake,and  
> > start a new VM and let it join into cluster,It turns out status is still  
> > red and All of shards is unassigned.
> > 
> > 1.is there any way to recover the status to green?  
> > 2.is there any chance I can recovered the data node's data?because I  
> > terminated the only data node  
> > 3.And if I met this situation again,I mean "During indexing ,cluster  
> > status became from green to red,and there is part of unassigned shards".How  
> > can I recover status to green
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/wvYXXwLgx\_o/unsubscribe](https://groups.google.com/d/topic/elasticsearch/wvYXXwLgx_o/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/acfe086c-32d0-47c9-aa2d-39f2ac58986d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/acfe086c-32d0-47c9-aa2d-39f2ac58986d%40googlegroups.com)  
> > .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAJ%3DxLsX9jBYC2JSQFEjicO2tyMAPSun024ho3JiD064Ny%2BOTFQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJ%3DxLsX9jBYC2JSQFEjicO2tyMAPSun024ho3JiD064Ny%2BOTFQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [December 18, 2013, 6:08am UTC](https://discuss.elastic.co/t/how-to-resolve-elasticsearch-status-red/14885/4 "2013-12-18T06:08:36Z")

</div>

I would set back and ask the question: why are you using a single data node  
and a single search node? Are you servers vastly different?

Dedicated search nodes have the primary function of offloading the result  
aggregation process from the data nodes. However, you only have one data  
node, so the search node is aggregating the results from a single server.

--  
Ivan

On Mon, Dec 16, 2013 at 2:48 AM, xiaoliang tian [xiaoliang.tian@gmail.com](mailto:xiaoliang.tian@gmail.com)wrote:

> I have one master 1 data and 1 search node,Then are running on AWS
> 
> During indexing ,cluster status became from green to red,and there is part  
> of unassigned shards,I terminated the only data node by mistake,and start a  
> new VM and let it join into cluster,It turns out status is still red and  
> All of shards is unassigned.
> 
> 1.is there any way to recover the status to green?  
> 2.is there any chance I can recovered the data node's data?because I  
> terminated the only data node  
> 3.And if I met this situation again,I mean "During indexing ,cluster  
> status became from green to red,and there is part of unassigned shards".How  
> can I recover status to green
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/bc9de699-59f6-46a9-8384-64a76878b03d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc9de699-59f6-46a9-8384-64a76878b03d%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQC96WCtc\_MB%3DxaXbibGbFOqDXq84Ne8aF5c6APS3bUoKA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQC96WCtc_MB%3DxaXbibGbFOqDXq84Ne8aF5c6APS3bUoKA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:00am UTC](https://discuss.elastic.co/t/how-to-resolve-elasticsearch-status-red/14885/5 "2017-07-06T02:00:30Z")

</div>


