I have an ELK stack with two ElasticSearch nodes, and the cluster state turned red due to some unrecognized shards that I cannot get rid of. A look at the unrecognized shard, respectively. incomplete index with:
# curl -s elastic01.local:9200/_cat/shards | grep "logstash-2014.09.29"
Shows:
logstash-2014.09.29 4 p STARTED 745489 481.3mb 10.165.98.107 Crimson and the Raven logstash-2014.09.29 4 r STARTED 745489 481.3mb 10.165.98.106 Glenn Talbot logstash-2014.09.29 0 p STARTED 781110 502.3mb 10.165.98.107 Crimson and the Raven logstash-2014.09.29 0 r STARTED 781110 502.3mb 10.165.98.106 Glenn Talbot logstash-2014.09.29 3 p INITIALIZING 10.165.98.107 Crimson and the Raven logstash-2014.09.29 3 r UNASSIGNED logstash-2014.09.29 1 p STARTED 762991 490.1mb 10.165.98.107 Crimson and the Raven logstash-2014.09.29 1 r STARTED 762991 490.1mb 10.165.98.106 Glenn Talbot logstash-2014.09.29 2 p STARTED 761811 491.3mb 10.165.98.107 Crimson and the Raven logstash-2014.09.29 2 r STARTED 761811 491.3mb 10.165.98.106 Glenn Talbot
My attempt to assign a fragment to another node fails:
curl XPOST -s 'http://elastic01.local:9200/_cluster/reroute?pretty=true' -d '{ "commands" : [ { "allocate" : { "index" : "logstash-2014.09.29", "shard" : 3 , "node" : "Glenn Talbot", "allow_primary" : 1 } } ] }'
FROM
NO(primary shard is not yet active)]
I really can't find an API to promote shard states. How can I continue here?
Just for a complete picture, what the state of the system looks like:
{ "cluster_name" : "logstash_es", "status" : "red", "timed_out" : false, "number_of_nodes" : 2, "number_of_data_nodes" : 2, "active_primary_shards" : 114, "active_shards" : 228, "relocating_shards" : 0, "initializing_shards" : 1, "unassigned_shards" : 1 }
Thank you for your time and help.