# Unassigned shards

**URL:** <https://discuss.elastic.co/t/unassigned-shards/14633>\
**Category:** Elasticsearch\
**Created:** [November 28, 2013, 3:28pm UTC](https://discuss.elastic.co/t/unassigned-shards/14633 "2013-11-28T15:28:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Honza](https://avatars.discourse-cdn.com/v4/letter/h/e9bcb4/32.png) [@Honza](https://discuss.elastic.co/u/Honza)\
**Post date:** [November 28, 2013, 3:28pm UTC](https://discuss.elastic.co/t/unassigned-shards/14633/1 "2013-11-28T15:28:06Z")

</div>

Hi there,  
I've got a problem with unassigned shards. If I use the state command to  
get all shards, every of these has one started and one unassigned.

"shards" : {  
"0" : [ {  
"state" : "STARTED",  
"primary" : true,  
"node" : "dhzWgQR3QOiuOnB9qICSew",  
"relocating\_node" : null,  
"shard" : 0,  
"index" : "logstash-2013.11.27"  
}, {  
"state" : "UNASSIGNED",  
"primary" : false,  
"node" : null,  
"relocating\_node" : null,  
"shard" : 0,  
"index" : "logstash-2013.11.27"  
} ], ...

It means, that the cluster.health command returns:  
{  
"cluster\_name" : "elasticsearch",  
"status" : "yellow",  
"timed\_out" : false,  
"number\_of\_nodes" : 1,  
"number\_of\_data\_nodes" : 1,  
"active\_primary\_shards" : 105,  
"active\_shards" : 105,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 105  
}

But now I do not know how to get rid of the unassigned shards to get green  
status.  
I tried cluster reroute[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-reroute.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-reroute.html),  
but it returns  
{"error":"ElasticSearchIllegalArgumentException[[allocate] allocation of  
[logstash-2013.11.12][0] on node [Red  
Ronin][dhzWgQR3QOiuOnB9qICSew][inet[[server.com/192.168.5.183:9300](http://server.com/192.168.5.183:9300)]] is not  
allowed, reason:  
[NO()][YES()][YES()][YES()][YES()][YES()][YES()]]","status":400}

Don't you have any idea how to solve the problem, please?  
Thank you

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b44d2600-7fff-4286-bf5e-3a9b374f07a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b44d2600-7fff-4286-bf5e-3a9b374f07a0%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [November 28, 2013, 3:35pm UTC](https://discuss.elastic.co/t/unassigned-shards/14633/2 "2013-11-28T15:35:15Z")

</div>

Start a new node.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 28 nov. 2013 à 16:28, Honza [dufeja@gmail.com](mailto:dufeja@gmail.com) a écrit :

> Hi there,  
> I've got a problem with unassigned shards. If I use the state command to get all shards, every of these has one started and one unassigned.
> 
> "shards" : {  
> "0" : [ {  
> "state" : "STARTED",  
> "primary" : true,  
> "node" : "dhzWgQR3QOiuOnB9qICSew",  
> "relocating\_node" : null,  
> "shard" : 0,  
> "index" : "logstash-2013.11.27"  
> }, {  
> "state" : "UNASSIGNED",  
> "primary" : false,  
> "node" : null,  
> "relocating\_node" : null,  
> "shard" : 0,  
> "index" : "logstash-2013.11.27"  
> } ], ...
> 
> It means, that the cluster.health command returns:  
> {  
> "cluster\_name" : "elasticsearch",  
> "status" : "yellow",  
> "timed\_out" : false,  
> "number\_of\_nodes" : 1,  
> "number\_of\_data\_nodes" : 1,  
> "active\_primary\_shards" : 105,  
> "active\_shards" : 105,  
> "relocating\_shards" : 0,  
> "initializing\_shards" : 0,  
> "unassigned\_shards" : 105  
> }
> 
> But now I do not know how to get rid of the unassigned shards to get green status.  
> I tried cluster reroute, but it returns  
> {"error":"ElasticSearchIllegalArgumentException[[allocate] allocation of [logstash-2013.11.12][0] on node [Red Ronin][dhzWgQR3QOiuOnB9qICSew][inet[[server.com/192.168.5.183:9300](http://server.com/192.168.5.183:9300)]] is not allowed, reason: [NO()][YES()][YES()][YES()][YES()][YES()][YES()]]","status":400}
> 
> Don't you have any idea how to solve the problem, please?  
> Thank you
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b44d2600-7fff-4286-bf5e-3a9b374f07a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b44d2600-7fff-4286-bf5e-3a9b374f07a0%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/D9496591-8D02-49B5-B1D1-F9162134B1EA%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/D9496591-8D02-49B5-B1D1-F9162134B1EA%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [November 28, 2013, 4:20pm UTC](https://discuss.elastic.co/t/unassigned-shards/14633/3 "2013-11-28T16:20:10Z")

</div>

Please reply to the mailing list.

Yes I can. Elasticsearch is distributed. By default an index is split into 5 shards and ask for 1 replica per shard.  
When you have a single node, the first 5 primary shards are allocated on that node.  
5 replicated shards are not allocated as it does not make sense to make copies of same data on the same node, right?

When you start a new node, it join the cluster. Elasticsearch can now allocate the replicas.

That said, in development, you don't really have to worry about YELLOW status. It does not mean that your cluster does not work. It only indicates that if you loose another node you will probably have problems!

You can create an index without replica. In that case, your cluster will remain green: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html#indices-create-index](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html#indices-create-index)  
You can also decrease the number of replica on a live index: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html#indices-update-settings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html#indices-update-settings)

Have a look at this small video: [http://www.elasticsearch.org/videos/distributed-diagram/](http://www.elasticsearch.org/videos/distributed-diagram/)  
And others as well here: [http://www.elasticsearch.org/videos/](http://www.elasticsearch.org/videos/)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 28 novembre 2013 at 16:51:29, Honza ([dufeja@gmail.com](mailto:dufeja@gmail.com)) a écrit:

Thanks for your answer, it really works!  
But I would like to know why 🙂 Can you explain it to me, please?

Thank you

Dne čtvrtek, 28. listopadu 2013 16:35:15 UTC+1 David Pilato napsal(a):  
Start a new node.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 28 nov. 2013 à 16:28, Honza [duf...@gmail.com](mailto:duf...@gmail.com) a écrit :

Hi there,  
I've got a problem with unassigned shards. If I use the state command to get all shards, every of these has one started and one unassigned.

"shards" : {  
"0" : [ {  
"state" : "STARTED",  
"primary" : true,  
"node" : "dhzWgQR3QOiuOnB9qICSew",  
"relocating\_node" : null,  
"shard" : 0,  
"index" : "logstash-2013.11.27"  
}, {  
"state" : "UNASSIGNED",  
"primary" : false,  
"node" : null,  
"relocating\_node" : null,  
"shard" : 0,  
"index" : "logstash-2013.11.27"  
} ], ...

It means, that the cluster.health command returns:  
{  
"cluster\_name" : "elasticsearch",  
"status" : "yellow",  
"timed\_out" : false,  
"number\_of\_nodes" : 1,  
"number\_of\_data\_nodes" : 1,  
"active\_primary\_shards" : 105,  
"active\_shards" : 105,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 105  
}

But now I do not know how to get rid of the unassigned shards to get green status.  
I tried cluster reroute, but it returns  
{"error":"ElasticSearchIllegalArgumentException[[allocate] allocation of [logstash-2013.11.12][0] on node [Red Ronin][dhzWgQR3QOiuOnB9qICSew][inet[[server.com/192.168.5.183:9300](http://server.com/192.168.5.183:9300)]] is not allowed, reason: [NO()][YES()][YES()][YES()][YES()][YES()][YES()]]","status":400}

Don't you have any idea how to solve the problem, please?  
Thank you

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b44d2600-7fff-4286-bf5e-3a9b374f07a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b44d2600-7fff-4286-bf5e-3a9b374f07a0%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.52976d3a.4ad084e9.3e14%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.52976d3a.4ad084e9.3e14%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:04am UTC](https://discuss.elastic.co/t/unassigned-shards/14633/4 "2017-07-06T02:04:17Z")

</div>


