I'm running ES 2.4.3 as a single node on my laptop.
I'm creating an index with number_of_replicas >= 2. Then I close the index and open it again. After opening, all shards remain unassigned (and cluster becomes red).
Why is this happening? If I create index with number_of_replicas=1, it all works fine.
Reproduction:
$ curl -XPUT 'http://localhost:9200/foo/?pretty' -d '{ "settings": {"index": {"number_of_replicas": 2}}}'
{
"acknowledged" : true
}
$ curl localhost:9200/_cluster/health/foo?pretty
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 5,
"active_shards" : 5,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 10,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 47.45762711864407
}
$ curl -XPOST localhost:9200/foo/_close?pretty
{
"acknowledged" : true
}
$ curl -XPOST localhost:9200/foo/_open?pretty
{
"acknowledged" : true
}
$ curl localhost:9200/_cluster/health/foo?pretty
{
"cluster_name" : "elasticsearch",
"status" : "red",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 0,
"active_shards" : 0,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 15,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 38.983050847457626
}
Note that the cluster is Red and all foo
shards are unassigned.