# Unassigned shards allocation

**URL:** <https://discuss.elastic.co/t/unassigned-shards-allocation/55870>\
**Category:** Elasticsearch\
**Created:** [July 19, 2016, 11:38am UTC](https://discuss.elastic.co/t/unassigned-shards-allocation/55870 "2016-07-19T11:38:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [July 19, 2016, 11:38am UTC](https://discuss.elastic.co/t/unassigned-shards-allocation/55870/1 "2016-07-19T11:38:55Z")

</div>

Hi All,

Please suggest how to resolve the unassigned shards -

curl [http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)  
{  
"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" : 279,  
"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" : 0.0  
}

Regards,  
Prateek

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 19, 2016, 11:39am UTC](https://discuss.elastic.co/t/unassigned-shards-allocation/55870/2 "2016-07-19T11:39:45Z")

</div>

Logs?

---

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [July 19, 2016, 11:55am UTC](https://discuss.elastic.co/t/unassigned-shards-allocation/55870/3 "2016-07-19T11:55:26Z")

</div>

I had just executed below curl command referring other topics  
curl -XPUT [http://localhost:9200/\_settings](http://localhost:9200/_settings) -d {"number\_of\_replicas":1}

Which changed the status from red to yellow-

curl [http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)  
{  
"cluster\_name" : "ELASTICSEARCH",  
"status" : "yellow",  
"timed\_out" : false,  
"number\_of\_nodes" : 1,  
"number\_of\_data\_nodes" : 1,  
"active\_primary\_shards" : 71,  
"active\_shards" : 71,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 71,  
"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.0  
}

Regards,  
Prateek

---

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [July 19, 2016, 12:20pm UTC](https://discuss.elastic.co/t/unassigned-shards-allocation/55870/4 "2016-07-19T12:20:53Z")

</div>

> [@Prateek\_Kshtriya](#):
>
> "unassigned\_shards" : 71,

Please suggest how to resolve unassigned shards.

If I change number of replicas to 0 then cluster changes to green status but it goes to yellow as soon as it is changed to 1  
curl -XPUT [http://localhost:9200/\_settings](http://localhost:9200/_settings) -d {"number\_of\_replicas":0}

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 19, 2016, 1:09pm UTC](https://discuss.elastic.co/t/unassigned-shards-allocation/55870/5 "2016-07-19T13:09:07Z")

</div>

You can't have replicas allocated with only one node.

---

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [July 20, 2016, 5:31am UTC](https://discuss.elastic.co/t/unassigned-shards-allocation/55870/6 "2016-07-20T05:31:25Z")

</div>

Thank you David for quick reply.

---

<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 5, 2017, 10:34pm UTC](https://discuss.elastic.co/t/unassigned-shards-allocation/55870/7 "2017-07-05T22:34:15Z")

</div>


