# ES 6.5 unassigned\_shards":1000 do not get assigned - status yellow

**URL:** https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478
**Category:** Elasticsearch
**Created:** [June 26, 2019, 6:09am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478 "2019-06-26T06:09:38Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Stefan\_Bauer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefan_bauer/32/46221_2.png) [@Stefan\_Bauer](https://discuss.elastic.co/u/Stefan_Bauer)
#### Post date: [June 26, 2019, 6:09am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478/1 "2019-06-26T06:09:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [June 26, 2019, 6:15am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478/2 "2019-06-26T06:15:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Stefan\_Bauer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefan_bauer/32/46221_2.png) [@Stefan\_Bauer](https://discuss.elastic.co/u/Stefan_Bauer)
#### Post date: [June 26, 2019, 6:36am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478/3 "2019-06-26T06:36:21Z")

</div>

How can we check this?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [June 26, 2019, 7:16am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478/4 "2019-06-26T07:16:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Stefan\_Bauer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefan_bauer/32/46221_2.png) [@Stefan\_Bauer](https://discuss.elastic.co/u/Stefan_Bauer)
#### Post date: [June 26, 2019, 7:49am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478/5 "2019-06-26T07:49:23Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Stefan\_Bauer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefan_bauer/32/46221_2.png) [@Stefan\_Bauer](https://discuss.elastic.co/u/Stefan_Bauer)
#### Post date: [June 26, 2019, 8:47am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478/6 "2019-06-26T08:47:42Z")

</div>

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
  }
}
```
````

---

<div class="post-metadata">

### Author: ![EldrosKandar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eldroskandar/32/33188_2.png) [@EldrosKandar](https://discuss.elastic.co/u/EldrosKandar)
#### Post date: [June 26, 2019, 8:54am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478/7 "2019-06-26T08:54:32Z")

</div>

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](https://discuss.elastic.co/t/es6-x-prevent-new-index-to-be-created-with-replica-shards/178168/5).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 24, 2019, 8:54am UTC](https://discuss.elastic.co/t/es-6-5-unassigned-shards-1000-do-not-get-assigned-status-yellow/187478/8 "2019-07-24T08:54:36Z")

</div>

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