my cluster is with yellow status because some shards are unassigned. what to do with this?
I tried set cluster.routing.allocation.disable_allocation = false
to all indexes, but I think this don't work because I'm using version 1.1.1.
I also tried restarting all machines, but same happens.
Any idea?
EDIT :
Cluster stat :
{ cluster_name: "elasticsearch", status: "red", timed_out: false, number_of_nodes: 5, number_of_data_nodes: 4, active_primary_shards: 4689, active_shards: 4689, relocating_shards: 0, initializing_shards: 10, unassigned_shards: 758 }
In this scenario, you have to decide how to proceed: try to get the original node to recover and rejoin the cluster (and do not force allocate the primary shard), or force allocate the shard using the Cluster Reroute API and reindex the missing data using the original data source, or from a backup.
Elasticsearch. Elasticsearch's shard allocation system can get complicated. When we create index, or have one of our nodes crashed, shards may go into unassigned state. Meaning, data is there but it is not assigned/replicated to a node to enable processing that shard.
The new name of this setting is: cluster. routing. allocation. enable <code> Enable or disable allocation for specific kinds of shards: all - (default) Allows shard allocation for all kinds of shards.
There are many possible reason why allocation won't occur:
As a general rule, you can troubleshoot things like this:
curl -s 'localhost:9200/_cat/nodes?v'
. If you only have one node, you need to set number_of_replicas
to 0. (See ES documentation or other answers).curl -s 'localhost:9200/_cat/allocation?v'
curl 'http://localhost:9200/_cluster/settings?pretty'
and look for cluster.routing
settingscurl -s localhost:9200/_cat/shards?v | grep UNASS
Try to force a shard to be assigned
curl -XPOST -d '{ "commands" : [ { "allocate" : { "index" : ".marvel-2014.05.21", "shard" : 0, "node" : "SOME_NODE_HERE", "allow_primary":true } } ] }' http://localhost:9200/_cluster/reroute?pretty
Look at the response and see what it says. There will be a bunch of YES's that are ok, and then a NO. If there aren't any NO's, it's likely a firewall/SELinux problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With