# Shards unbalanced distribution

**URL:** https://discuss.elastic.co/t/shards-unbalanced-distribution/241569
**Category:** Elasticsearch
**Created:** [July 17, 2020, 2:04am UTC](https://discuss.elastic.co/t/shards-unbalanced-distribution/241569 "2020-07-17T02:04:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![LuckyNemo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luckynemo/32/67133_2.png) [@LuckyNemo](https://discuss.elastic.co/u/LuckyNemo)
#### Post date: [July 17, 2020, 2:04am UTC](https://discuss.elastic.co/t/shards-unbalanced-distribution/241569/1 "2020-07-17T02:04:36Z")

</div>

ES version 6.0.0  
8 nodes(5 datanode 3 ingests,all are 8c16g config)  
I have a index (5 primary 1 replica) mapping like this

```auto
{
  "myindex": {
    "mappings": {
      "order": {
        "properties": {
          "addTime": {
            "type": "date"
          },
          "channelId": {
            "type": "long"
          },
          "content": {
            "type": "text",
          },
          "contentId": {
            "type": "long"
          },
          "status": {
            "type": "long"
          }
        }
      }
    }
  }
}

```

index has no routingId

but when I using API "GET \_cat/shards/myindex?v",data distribution as below:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/5/e51e55eccbbb17481311a09d339c5f8dad753aad.png)

node's load and threadPool are normal not busy or high.  
I have done a experiment like this:

1.fetch about myindex 100 0000 doc\_id(related to time not autoid generated by es)  
2. mod(doc\_id,5),  
3.get the distribution of doc\_id  
4. result is very balance

So anyone can tell me why this happened? It should be balance without routingId in my opinion.  
thx for ur time!

---

<div class="post-metadata">

### Author: ![Vinayak\_Sapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinayak_sapre/32/45939_2.png) [@Vinayak\_Sapre](https://discuss.elastic.co/u/Vinayak_Sapre)
#### Post date: [July 17, 2020, 2:18am UTC](https://discuss.elastic.co/t/shards-unbalanced-distribution/241569/2 "2020-07-17T02:18:11Z")

</div>

@LuckyNemo  
If you are expecting step 3 to reflect docs distribution in shards, you need to get distribution of hash(doc\_id) using exact hash function used by ElasticSearch.

---

<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: [August 14, 2020, 2:18am UTC](https://discuss.elastic.co/t/shards-unbalanced-distribution/241569/3 "2020-08-14T02:18:17Z")

</div>

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