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

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
{"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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b3915846-143e-4af8-a99b-962a79e76663%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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 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
{"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.
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?utm_medium=email&utm_source=footer
.
For more options, visit 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.
To view this discussion on the web visit 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.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e615fa56-30b8-4f09-9d26-30b8e295477b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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 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.
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?utm_medium=email&utm_source=footer
.
For more options, visit 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.
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.
For more options, visit https://groups.google.com/d/optout.