# Cluster Healt Status "red", I can´t add data on some of my index

**URL:** https://discuss.elastic.co/t/cluster-healt-status-red-i-can-t-add-data-on-some-of-my-index/23101
**Category:** Elasticsearch
**Created:** [April 5, 2015, 11:13pm UTC](https://discuss.elastic.co/t/cluster-healt-status-red-i-can-t-add-data-on-some-of-my-index/23101 "2015-04-05T23:13:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Tiago\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tiago\_Rodrigues](https://discuss.elastic.co/u/Tiago_Rodrigues)
#### Post date: [April 5, 2015, 11:13pm UTC](https://discuss.elastic.co/t/cluster-healt-status-red-i-can-t-add-data-on-some-of-my-index/23101/1 "2015-04-05T23:13:11Z")

</div>

I have two servers on the same network with ElasticSearch (one for testing  
and one for production), apparently they communicate with each other, and  
this information was not clear to me until I have this problem.

After some time using the ElasticSearch to store data, some queries Index  
were not working. When I checked the command "curl -XGET http: //  
localhost: 9200 / \_cluster / health pretty" the result was as follows:

{  
"Cluster\_name": "ElasticSearch"  
"Status", "red",  
"Timed\_out": false,  
"Number\_of\_nodes": 1,  
"Number\_of\_data\_nodes": 1,  
"Active\_primary\_shards": 58,  
"Active\_shards": 58,  
"Relocating\_shards": 0,  
"Initializing\_shards": 0,  
"Unassigned\_shards": 142,  
"Number\_of\_pending\_tasks": 0  
}

Researching about the problem, I found two solutions, the first is to erase  
all data and start from zero (which is impractical at this stage), the  
other solution is to transfer the data indexed in the test server to the  
production server and cut connection between them. My problem with the  
second alternative is because I have no more data in the testing server  
because I manually delete the ElasticSearch on my test server.

I know it's inevitable that I lose some of the data that have been added to  
the production server, but I wonder if there is any way to recover the data  
of maximum and reurn to add data normally.

Some error logs I found that may be useful:

On ElasticSearch.log when I try to add something:

[2015-04-05 15:55:07] log.ERROR: 503 Server Exception: Server error response  
[status code] 503  
[reason phrase] Service Unavailable  
[url] [http://localhost:9200/myindex/mytype](http://localhost:9200/myindex/mytype)  
{"error":"UnavailableShardsException[[mixkids][3] Primary shard is not  
active or isn't assigned to a known node. Timeout: [1m], request: index  
{[myindex][mytype][AUyK7sucZwoXoezgxc43],  
source[{"id":"AUyK7styZwoXoezgxc4u","ativo":false,"tipo":"local","nome":"Estacionamento  
Maluco","link":"jogos\/crazyparking\/"}]}]","status":503} []  
{"file":"/var/folderofmyproject/php/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php","line":189,"class":"Elasticsearch\Connections\GuzzleConnection","function":"process5xxError"}

On PHP.log when I try to add something:

  
**Fatal error** : Uncaught exception 'Guzzle\Http\Exception\ServerErrorResponseException' with message 'Server error response [status code] 503 [reason phrase] Service Unavailable [url] http://localhost:9200/myindex/mytype' in /var/folderofmyproject/php/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:44 Stack trace: #0 /var/folderofmyproject/php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response)) #1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event)) #2/var/folderofmyproject/php/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call\_user\_func(Array, Object(Guzzle\Common\Event)) #3 /var/customers/webs/educamix/kids/areadospais/php/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDis in **/var/customers/webs/educamix/kids/areadospais/php/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php** on line **198**  

I using Elasticsearch 1.5 (recently upgraded from 0.9) and PHP

Sorry for my poor English, and all help is welcome.

--  
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/b3915846-143e-4af8-a99b-962a79e76663%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b3915846-143e-4af8-a99b-962a79e76663%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 6, 2015, 12:17am UTC](https://discuss.elastic.co/t/cluster-healt-status-red-i-can-t-add-data-on-some-of-my-index/23101/2 "2015-04-06T00:17:06Z")

</div>

If you have already deleted data from the other host then you are out of  
luck and you can only recover the data that you have on the existing server.  
You'll have to re-index unfortunately.

On 6 April 2015 at 09:13, Tiago Rodrigues [tiago\_tk21@hotmail.com](mailto:tiago_tk21@hotmail.com) wrote:

> I have two servers on the same network with Elasticsearch (one for testing  
> and one for production), apparently they communicate with each other, and  
> this information was not clear to me until I have this problem.
> 
> After some time using the Elasticsearch to store data, some queries Index  
> were not working. When I checked the command "curl -XGET http: //  
> localhost: 9200 / \_cluster / health pretty" the result was as follows:
> 
> {  
> "Cluster\_name": "Elasticsearch"  
> "Status", "red",  
> "Timed\_out": false,  
> "Number\_of\_nodes": 1,  
> "Number\_of\_data\_nodes": 1,  
> "Active\_primary\_shards": 58,  
> "Active\_shards": 58,  
> "Relocating\_shards": 0,  
> "Initializing\_shards": 0,  
> "Unassigned\_shards": 142,  
> "Number\_of\_pending\_tasks": 0  
> }
> 
> Researching about the problem, I found two solutions, the first is to  
> erase all data and start from zero (which is impractical at this stage),  
> the other solution is to transfer the data indexed in the test server to  
> the production server and cut connection between them. My problem with the  
> second alternative is because I have no more data in the testing server  
> because I manually delete the Elasticsearch on my test server.
> 
> I know it's inevitable that I lose some of the data that have been added  
> to the production server, but I wonder if there is any way to recover the  
> data of maximum and reurn to add data normally.
> 
> Some error logs I found that may be useful:
> 
> On Elasticsearch.log when I try to add something:
> 
> [2015-04-05 15:55:07] log.ERROR: 503 Server Exception: Server error  
> response  
> [status code] 503  
> [reason phrase] Service Unavailable  
> [url] [http://localhost:9200/myindex/mytype](http://localhost:9200/myindex/mytype)  
> {"error":"UnavailableShardsException[[mixkids][3] Primary shard is not  
> active or isn't assigned to a known node. Timeout: [1m], request: index  
> {[myindex][mytype][AUyK7sucZwoXoezgxc43],  
> source[{"id":"AUyK7styZwoXoezgxc4u","ativo":false,"tipo":"local","nome":"Estacionamento  
> Maluco","link":"jogos\/crazyparking\/"}]}]","status":503}   
> {"file":"/var/folderofmyproject/php/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php","line":189,"class":"Elasticsearch\Connections\GuzzleConnection","function":"process5xxError"}
> 
> On PHP.log when I try to add something:
> 
>   
> **Fatal error** : Uncaught exception 'Guzzle\Http\Exception\ServerErrorResponseException' with message 'Server error response [status code] 503 [reason phrase] Service Unavailable [url] http://localhost:9200/myindex/mytype' in /var/folderofmyproject/php/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:44 Stack trace: #0 /var/folderofmyproject/php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response)) #1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event)) #2/var/folderofmyproject/php/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call\_user\_func(Array, Object(Guzzle\Common\Event)) #3 /var/customers/webs/educamix/kids/areadospais/php/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDis in **/var/customers/webs/educamix/kids/areadospais/php/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php** on line **198**  
> 
> I using Elasticsearch 1.5 (recently upgraded from 0.9) and PHP
> 
> Sorry for my poor English, and all help is welcome.
> 
> --  
> 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/b3915846-143e-4af8-a99b-962a79e76663%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b3915846-143e-4af8-a99b-962a79e76663%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b3915846-143e-4af8-a99b-962a79e76663%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b3915846-143e-4af8-a99b-962a79e76663%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAEYi1X8UWMbt-zo-bmVj4rS-AquYtwpGokfUbset%2BYC06V42vg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8UWMbt-zo-bmVj4rS-AquYtwpGokfUbset%2BYC06V42vg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Tiago\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tiago\_Rodrigues](https://discuss.elastic.co/u/Tiago_Rodrigues)
#### Post date: [April 6, 2015, 1:27am UTC](https://discuss.elastic.co/t/cluster-healt-status-red-i-can-t-add-data-on-some-of-my-index/23101/3 "2015-04-06T01:27:18Z")

</div>

Thanks for your reply,

I already thought I had lost the data of another server, it really was not  
wise to delete the ElasticSearch when I discovered the problem.

So please tell me how is the procedure to re-index the data?

--  
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/e615fa56-30b8-4f09-9d26-30b8e295477b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e615fa56-30b8-4f09-9d26-30b8e295477b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [April 6, 2015, 9:10pm UTC](https://discuss.elastic.co/t/cluster-healt-status-red-i-can-t-add-data-on-some-of-my-index/23101/4 "2015-04-06T21:10:04Z")

</div>

That's really up to how you want to do it, how did the data get in there  
before?

On 6 April 2015 at 11:27, Tiago Rodrigues [tiago\_tk21@hotmail.com](mailto:tiago_tk21@hotmail.com) wrote:

> Thanks for your reply,
> 
> I already thought I had lost the data of another server, it really was not  
> wise to delete the Elasticsearch when I discovered the problem.
> 
> So please tell me how is the procedure to re-index the data?
> 
> --  
> 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/e615fa56-30b8-4f09-9d26-30b8e295477b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e615fa56-30b8-4f09-9d26-30b8e295477b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/e615fa56-30b8-4f09-9d26-30b8e295477b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e615fa56-30b8-4f09-9d26-30b8e295477b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAEYi1X\_tN1%2B%3Dzs2%2BLRZMTS%2Bq9\_O\_bFkaJTJiCsQPVx6-Usapew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X_tN1%2B%3Dzs2%2BLRZMTS%2Bq9_O_bFkaJTJiCsQPVx6-Usapew%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:21am UTC](https://discuss.elastic.co/t/cluster-healt-status-red-i-can-t-add-data-on-some-of-my-index/23101/5 "2017-07-06T00:21:23Z")

</div>


