# How to identify number of shards based on the nodes

**URL:** <https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071>\
**Category:** Elasticsearch\
**Created:** [April 30, 2018, 9:54pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071 "2018-04-30T21:54:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [April 30, 2018, 9:54pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/1 "2018-04-30T21:54:17Z")

</div>

I have a 5 node Elasticsearch cluster of version 5.2.1. It consist of 3 master and 2 data node. I defined no.of shards as 7 and replica as 1.

With this setting sometimes my shards health are going to yellow status. Which causing Elasticsearch timeout issue when I access Kibana I doubt it whether the number of shards causing this issue.

Is there any formula to identify number of shards based on the nodes in the cluster? . Please provide your insights.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 1, 2018, 4:48am UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/2 "2018-05-01T04:48:19Z")

</div>

How many shards do you have in the cluster? What is the average shard size?

As you have only 2 data nodes (the only nodes that hold shards) both nodes will hold a copy of all data as you have 1 replica configured. I would recommend reading [this blog post](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster) for some practical guidance on shard count and size.

---

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [May 1, 2018, 4:13pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/3 "2018-05-01T16:13:55Z")

</div>

I have 7 shards and 1 replica and my avg shard size is 25GB

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 1, 2018, 4:14pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/4 "2018-05-01T16:14:52Z")

</div>

So only a single index?

---

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [May 1, 2018, 4:25pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/5 "2018-05-01T16:25:23Z")

</div>

I have 16 different application indices.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 1, 2018, 4:26pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/6 "2018-05-01T16:26:39Z")

</div>

So 16 \* 7 \* 2 = 224 shards in total?

---

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [May 1, 2018, 4:30pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/7 "2018-05-01T16:30:49Z")

</div>

Yes and the avg size of 1 shard is 25GB not 130 GB. I corrected my above response

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 1, 2018, 4:49pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/8 "2018-05-01T16:49:11Z")

</div>

If you want to see how shards are distributed across the cluster, you can use the [cat shards API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html). Is there anything in the Elasticsearch logs about the yellow status you mentioned?

---

<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:** [May 29, 2018, 4:50pm UTC](https://discuss.elastic.co/t/how-to-identify-number-of-shards-based-on-the-nodes/130071/9 "2018-05-29T16:50:13Z")

</div>

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