# List Unassigned shards by index by node

**URL:** <https://discuss.elastic.co/t/list-unassigned-shards-by-index-by-node/12560>\
**Category:** Elasticsearch\
**Created:** [June 27, 2013, 9:47am UTC](https://discuss.elastic.co/t/list-unassigned-shards-by-index-by-node/12560 "2013-06-27T09:47:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Amit](https://discuss.elastic.co/u/Amit)\
**Post date:** [June 27, 2013, 9:47am UTC](https://discuss.elastic.co/t/list-unassigned-shards-by-index-by-node/12560/1 "2013-06-27T09:47:10Z")

</div>

Hi All,

I have looked through to find out any api available to list down the  
unassigned shards.  
Currently the cluster health api only list the number of unassigned shards.

{  
"cluster\_name" : "elasticsearch",  
"status" : "red",  
"timed\_out" : false,  
"number\_of\_nodes" : 5,  
"number\_of\_data\_nodes" : 5,  
"active\_primary\_shards" : 36,  
"active\_shards" : 36,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
_"unassigned\_shards" : 3_  
}

But my requirement is to list down the unassigned shard along with the _index  
name and node_ that they belong to.

I have called the index status and segment api;

curl -XGET '[http://localhost:9200/\_status](http://localhost:9200/_status)' -- all shards have "state"  
"STARTED"  
curl -XGET '[http://localhost:9200/\_segments](http://localhost:9200/_segments)'

but I don't get which shards are faling.

Any help would be greatly appreciated.

Thanks  
Amit

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Israel\_Tsadok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/israel_tsadok/32/1283_2.png) [@Israel\_Tsadok](https://discuss.elastic.co/u/Israel_Tsadok)\
**Post date:** [June 27, 2013, 10:59am UTC](https://discuss.elastic.co/t/list-unassigned-shards-by-index-by-node/12560/2 "2013-06-27T10:59:01Z")

</div>

Look at the results of  
curl -XGET [http://localhost:9200/\_cluster/state?pretty=true](http://localhost:9200/_cluster/state?pretty=true)

- you'll probably want to pipe that into less. Search for the string  
UNASSIGNED.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On Thu, Jun 27, 2013 at 12:47 PM, Amit Singh [amitsingh.kec@gmail.com](mailto:amitsingh.kec@gmail.com)wrote:

> Hi All,
> 
> I have looked through to find out any api available to list down the  
> unassigned shards.  
> Currently the cluster health api only list the number of unassigned shards.
> 
> {  
> "cluster\_name" : "elasticsearch",  
> "status" : "red",  
> "timed\_out" : false,  
> "number\_of\_nodes" : 5,  
> "number\_of\_data\_nodes" : 5,  
> "active\_primary\_shards" : 36,  
> "active\_shards" : 36,  
> "relocating\_shards" : 0,  
> "initializing\_shards" : 0,  
> _"unassigned\_shards" : 3_  
> }
> 
> But my requirement is to list down the unassigned shard along with the _index  
> name and node_ that they belong to.
> 
> I have called the index status and segment api;
> 
> curl -XGET '[http://localhost:9200/\_status](http://localhost:9200/_status)' -- all shards have "state"  
> "STARTED"  
> curl -XGET '[http://localhost:9200/\_segments](http://localhost:9200/_segments)'
> 
> but I don't get which shards are faling.
> 
> Any help would be greatly appreciated.
> 
> Thanks  
> Amit
> 
> --  
> 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).  
> 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Amit](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Amit](https://discuss.elastic.co/u/Amit)\
**Post date:** [June 27, 2013, 11:47am UTC](https://discuss.elastic.co/t/list-unassigned-shards-by-index-by-node/12560/3 "2013-06-27T11:47:13Z")

</div>

Thanks Israel,

That helped , I called all other api except for cluster state api.

Now when I know the unassigned shards, I am trying to allocated them to a  
node.

curl -XPOST '10.62.145.101:9200/\_cluster/reroute' -d '{"commands" :  
[{"allocate" : "index"  
:"51c33c8d9a5cb0e4a498e94c ~~51c438855555b0e40a09137a~~ 1","shard" : 3,  
"node" : "fJxYr\_ZMQyagiA2ilKVLYA"}}]}'

But when I call the cluster state api , I still get the same result.  
I mean the shard did not got assigned to a node.

Thanks  
Amit

On Thu, Jun 27, 2013 at 4:29 PM, Israel Tsadok [itsadok@gmail.com](mailto:itsadok@gmail.com) wrote:

> Look at the results of  
> curl -XGET [http://localhost:9200/\_cluster/state?pretty=true](http://localhost:9200/_cluster/state?pretty=true)
> 
> - you'll probably want to pipe that into less. Search for the string  
> UNASSIGNED.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-cluster-state/)
> 
> On Thu, Jun 27, 2013 at 12:47 PM, Amit Singh [amitsingh.kec@gmail.com](mailto:amitsingh.kec@gmail.com)wrote:
> 
> > Hi All,
> > 
> > I have looked through to find out any api available to list down the  
> > unassigned shards.  
> > Currently the cluster health api only list the number of unassigned  
> > shards.
> > 
> > {  
> > "cluster\_name" : "elasticsearch",  
> > "status" : "red",  
> > "timed\_out" : false,  
> > "number\_of\_nodes" : 5,  
> > "number\_of\_data\_nodes" : 5,  
> > "active\_primary\_shards" : 36,  
> > "active\_shards" : 36,  
> > "relocating\_shards" : 0,  
> > "initializing\_shards" : 0,  
> > _"unassigned\_shards" : 3_  
> > }
> > 
> > But my requirement is to list down the unassigned shard along with the _index  
> > name and node_ that they belong to.
> > 
> > I have called the index status and segment api;
> > 
> > curl -XGET '[http://localhost:9200/\_status](http://localhost:9200/_status)' -- all shards have "state"  
> > "STARTED"  
> > curl -XGET '[http://localhost:9200/\_segments](http://localhost:9200/_segments)'
> > 
> > but I don't get which shards are faling.
> > 
> > Any help would be greatly appreciated.
> > 
> > Thanks  
> > Amit
> > 
> > --  
> > 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).  
> > 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).  
> 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![PrasathRajan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasathrajan/32/52874_2.png) [@PrasathRajan](https://discuss.elastic.co/u/PrasathRajan)\
**Post date:** [October 13, 2014, 11:18am UTC](https://discuss.elastic.co/t/list-unassigned-shards-by-index-by-node/12560/4 "2014-10-13T11:18:34Z")

</div>

Try this...

curl localhost:9200/\_cat/shards

---

<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, 12:56am UTC](https://discuss.elastic.co/t/list-unassigned-shards-by-index-by-node/12560/5 "2017-07-06T00:56:36Z")

</div>


