# API to see the index repartition overs shards

**URL:** <https://discuss.elastic.co/t/api-to-see-the-index-repartition-overs-shards/4096>\
**Category:** Elasticsearch\
**Created:** [March 15, 2011, 9:32am UTC](https://discuss.elastic.co/t/api-to-see-the-index-repartition-overs-shards/4096 "2011-03-15T09:32:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Heimburger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_heimburger/32/2941_2.png) [@Alexandre\_Heimburger](https://discuss.elastic.co/u/Alexandre_Heimburger)\
**Post date:** [March 15, 2011, 9:32am UTC](https://discuss.elastic.co/t/api-to-see-the-index-repartition-overs-shards/4096/1 "2011-03-15T09:32:12Z")

</div>

Hi there,

The question is in the title.

Is there any API to see how is balanced a given index over nodes and shards  
?

thanks

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 15, 2011, 9:34am UTC](https://discuss.elastic.co/t/api-to-see-the-index-repartition-overs-shards/4096/2 "2011-03-15T09:34:46Z")

</div>

The cluster state API gives you all the information you are after. Which nodes are in play, indices, shards, and where they are allocated (broken down from an index/shard perspective - routing\_table, and node perspective - routing\_nodes): [http://www.elasticsearch.org/guide/reference/api/admin-cluster-state.html](http://www.elasticsearch.org/guide/reference/api/admin-cluster-state.html).  
On Tuesday, March 15, 2011 at 11:32 AM, Alexandre Heimburger wrote:

> Hi there,
> 
> The question is in the title.
> 
> Is there any API to see how is balanced a given index over nodes and shards ?
> 
> thanks

---

<div class="post-metadata">

**Author:** ![Alexandre\_Heimburger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_heimburger/32/2941_2.png) [@Alexandre\_Heimburger](https://discuss.elastic.co/u/Alexandre_Heimburger)\
**Post date:** [March 15, 2011, 10:18am UTC](https://discuss.elastic.co/t/api-to-see-the-index-repartition-overs-shards/4096/3 "2011-03-15T10:18:28Z")

</div>

yes I had a look at this one.

I'm sorry if my questions are not relevant but is there any  
documentation about the meaning of each field. I understand most of  
them but I'd like to be sure.

For example :

```
    "shards" : {
      "0" : [ {
        "state" : "STARTED",
        "primary" : true,
        "node" : "5XqO4B39RrmJr5WyUQlTHA",
        "relocating_node" : null,
        "shard" : 0,
        "index" : "devalexbk10"
      }, {
        "state" : "STARTED",
        "primary" : false,
        "node" : "Z3N-KZAoT0KtdqTgel2-tQ",
        "relocating_node" : null,
        "shard" : 0,
        "index" : "devalexbk10"
      } ],

```

I guess that the shards 0 is defined on node 5XqO4B39RrmJr5WyUQlTHA  
(primary=true) and replicated on node Z3N-KZAoT0KtdqTgel2-tQ. Am I  
right ?

how do I know if a given node

On 15 mar, 10:34, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> The cluster state API gives you all the information you are after. Which nodes are in play, indices, shards, and where they are allocated (broken down from an index/shard perspective - routing\_table, and node perspective - routing\_nodes):[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-cluster-state).....
> 
> On Tuesday, March 15, 2011 at 11:32 AM, Alexandre Heimburger wrote:
> 
> > Hi there,
> 
> > The question is in the title.
> 
> > Is there any API to see how is balanced a given index over nodes and shards ?
> 
> > thanks

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 15, 2011, 6:55pm UTC](https://discuss.elastic.co/t/api-to-see-the-index-repartition-overs-shards/4096/4 "2011-03-15T18:55:16Z")

</div>

On Tuesday, March 15, 2011 at 12:18 PM, alheim wrote:  
yes I had a look at this one.

> I'm sorry if my questions are not relevant but is there any  
> documentation about the meaning of each field. I understand most of  
> them but I'd like to be sure.
> 
> For example :
> 
> "shards" : {  
> "0" : [ {  
> "state" : "STARTED",  
> "primary" : true,  
> "node" : "5XqO4B39RrmJr5WyUQlTHA",  
> "relocating\_node" : null,  
> "shard" : 0,  
> "index" : "devalexbk10"  
> }, {  
> "state" : "STARTED",  
> "primary" : false,  
> "node" : "Z3N-KZAoT0KtdqTgel2-tQ",  
> "relocating\_node" : null,  
> "shard" : 0,  
> "index" : "devalexbk10"  
> } ],
> 
> I guess that the shards 0 is defined on node 5XqO4B39RrmJr5WyUQlTHA  
> (primary=true) and replicated on node Z3N-KZAoT0KtdqTgel2-tQ. Am I  
> right ?  
> Right.
> 
> how do I know if a given node  
> ?. If I can guess the question, then the nodes info is also in the response, mapping node id to things like IP and names.
> 
> On 15 mar, 10:34, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > The cluster state API gives you all the information you are after. Which nodes are in play, indices, shards, and where they are allocated (broken down from an index/shard perspective - routing\_table, and node perspective - routing\_nodes):[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-cluster-state).....
> > 
> > On Tuesday, March 15, 2011 at 11:32 AM, Alexandre Heimburger wrote:
> > 
> > > Hi there,
> > 
> > > The question is in the title.
> > 
> > > Is there any API to see how is balanced a given index over nodes and shards ?
> > 
> > > thanks

---

<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, 4:10am UTC](https://discuss.elastic.co/t/api-to-see-the-index-repartition-overs-shards/4096/5 "2017-07-06T04:10:03Z")

</div>


