# Total number of shards

**URL:** https://discuss.elastic.co/t/total-number-of-shards/345749
**Category:** Elasticsearch
**Created:** [October 25, 2023, 4:33pm UTC](https://discuss.elastic.co/t/total-number-of-shards/345749 "2023-10-25T16:33:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lemospt](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@lemospt](https://discuss.elastic.co/u/lemospt)
#### Post date: [October 25, 2023, 4:33pm UTC](https://discuss.elastic.co/t/total-number-of-shards/345749/1 "2023-10-25T16:33:14Z")

</div>

Hi Guys,

i have an elastic cluster with 5 nodes. This cluster is configured 1290 indices, all indices is configured to have 2 primary shards and 1 replica shard.

For me the cluster should have 3\*1290=3870 shards but actually has 4952 shards (2476 primary and 2476 replica) and is close to the limit of 5000.

What is wrong with the number of shards?

Thanks for the help.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [October 25, 2023, 5:02pm UTC](https://discuss.elastic.co/t/total-number-of-shards/345749/2 "2023-10-25T17:02:07Z")

</div>

> [@lemospt](#):
>
> This cluster is configured 1290 indices, all indices is configured to have 2 primary shards and 1 replica shard.

Can you share the template you are using? If you have `number_of_shards` set to `2` and `number_of_replicas` set to `1`, this means that each primary shard will have a replica, so you will have 4 shards for this index.

> [@lemospt](#):
>
> For me the cluster should have 3\*1290=3870

This does not see right, as mentioned if you configure to have 2 primary shards and 1 replica, each primary will have one replica, so each index will have for shard.

For example, you will have `p0`, `p1` as the primary shards and `r0` and `r1` as their respective replicas.

> [@lemospt](#):
>
> What is wrong with the number of shards?

What is the result of `GET _cat/shards?v` on Kibana Dev Tools? Can you share it here or on a Github Gist?

---

<div class="post-metadata">

### Author: ![lemospt](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@lemospt](https://discuss.elastic.co/u/lemospt)
#### Post date: [October 26, 2023, 9:25am UTC](https://discuss.elastic.co/t/total-number-of-shards/345749/3 "2023-10-26T09:25:27Z")

</div>

Hi Leandro,

thanks for the explanation, now i understand the meaning of number\_of\_replicas. I thought it was the implicit number of replica shards but it means the number of replicas for every primary.  
Now it make sense to me.

---

<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: [November 23, 2023, 9:26am UTC](https://discuss.elastic.co/t/total-number-of-shards/345749/4 "2023-11-23T09:26:02Z")

</div>

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