ES 6.5 unassigned_shards":1000 do not get assigned - status yellow

Hi,

for unknown reasons after the last restart, elasticsearch has unassigned shards that do not get assigned and cluster status stays yellow. It's a single node host with no further adjustments.

root@kibana03:/# curl -XGET 'http://localhost:9200/_cluster/health'
{"cluster_name":"elasticsearch","status":"yellow","timed_out":false,"number_of_nodes":1,"number_of_data_nodes":1,"active_primary_shards":1010,"active_shards":1010,"relocating_shards":0,"initializing_shards":0,"unassigned_shards":1000,"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":50.24875621890548}

Index size is currently:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdc1       2,0T  750G  1,3T  38% /index


{
  "name" : "eRP8UvH",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "dJCYdbekQFGm5R0VMjD_cg",
  "version" : {
    "number" : "6.5.4",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "d2ef93d",
    "build_date" : "2018-12-17T21:17:40.758843Z",
    "build_snapshot" : false,
    "lucene_version" : "7.5.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

What to do?

Thank you.

Stefan

As you only have 1 node it may be that you have replica shards configured. Elasticsearch will never allocate a primary and its replica on the same node.

How can we check this?

As the status is yellow and not red that is generally the case.

Thank you. I was able to bring the status back to green with:

curl -H 'Content-Type: application/json' -XPUT http://127.0.0.1:9200/_settings -d '
{
    "index" : {
        "number_of_replicas" : 0
    }
}
'

Thats it or do i have to set it generally for all new indicies? If so, how can i do this?

Thank you very much for your time!

To answer my own questions. Seems to be:

```
curl -H 'Content-Type: application/json' -XPUT http://127.0.0.1:9200/_template/all
{
  "template": "*",
  "settings": {
    "number_of_replicas": 0
  }
}
```

Be aware there is a property named auto-expand-replicas which will create replica shards automatically on new indices if set to 0-1. For more information you can have a look here.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.