# How many records a shard can have?

**URL:** <https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034>\
**Category:** Elasticsearch\
**Created:** [October 24, 2017, 10:31am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034 "2017-10-24T10:31:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 24, 2017, 10:31am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/1 "2017-10-24T10:31:11Z")

</div>

What space or records a shard can have?

How to reallocate shards when primary shard is full?

How much data a index can have?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 25, 2017, 3:03am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/2 "2017-10-25T03:03:10Z")

</div>

A shard can hold a max of 2 billions docs. Other than that there's no size limit, but we recommend a max of less than 50GB as larger shards can mean slower (re)allocation.

---

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 25, 2017, 4:44am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/3 "2017-10-25T04:44:33Z")

</div>

How to perform shards re-allocation if i have 90gb data and I am getting **primary shard inactive exception**

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 25, 2017, 4:45am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/4 "2017-10-25T04:45:05Z")

</div>

Please post the entire error you are seeing.

---

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 25, 2017, 4:45am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/5 "2017-10-25T04:45:49Z")

</div>

[2017-10-24T12:29:47,946][INFO][logstash.outputs.elasticsearch] retrying failed action with response code: 503 (  
{"type"=\>"unavailable\_shards\_exception", "reason"=\>"[jdbc\_metadata\_pt\_new\_logs][2] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[jdbc\_metadata\_pt\_new\_logs][2]] containing [27] requests]"}  
)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 25, 2017, 4:46am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/6 "2017-10-25T04:46:09Z")

</div>

What do the Elasticsearch logs show?

---

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 25, 2017, 4:47am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/7 "2017-10-25T04:47:31Z")

</div>

I am unable to see that right now

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 25, 2017, 4:48am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/8 "2017-10-25T04:48:43Z")

</div>

What does `_cat/allocation` show?

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [October 25, 2017, 4:51am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/9 "2017-10-25T04:51:24Z")

</div>

you can re-allocate the shard settings as per your disk size allocation.Please refer below link:  
[https://www.elastic.co/guide/en/elasticsearch/reference/5.5/disk-allocator.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/disk-allocator.html)

---

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 25, 2017, 4:54am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/11 "2017-10-25T04:54:07Z")

</div>

I have already set \_cluster/settings  
still I am getting same error

---

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 25, 2017, 4:57am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/12 "2017-10-25T04:57:45Z")

</div>

\_cat/allocation is like this

823 5.9gb 74.1gb 24.3gb 98.4gb 75 ipaddress ipaddress 4kL3f1b  
829 UNASSIGNED

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 25, 2017, 4:58am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/13 "2017-10-25T04:58:31Z")

</div>

Do you have a single node?

---

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 25, 2017, 4:59am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/14 "2017-10-25T04:59:25Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [October 25, 2017, 5:06am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/15 "2017-10-25T05:06:25Z")

</div>

please share complete configuration of your set up and logs details for more understanding.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 25, 2017, 5:06am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/16 "2017-10-25T05:06:37Z")

</div>

Ok, well you probably have too many shards. It may not be causing this problem but it doesn't help.

If you can't see the Elasticsearch logs it makes things hard. What if you did a [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-allocation-explain.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-allocation-explain.html) on the index in question, what does that output?

---

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 25, 2017, 5:15am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/17 "2017-10-25T05:15:45Z")

</div>

I guess m getting this problem because my machine is out of disk space

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [October 25, 2017, 5:15am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/18 "2017-10-25T05:15:48Z")

</div>

seeing your previous error message it seems there is more shards but you have configured only one node due to this shards have no enough space for allocation.  
for resolving this i prefer you to configure more nodes for the same.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 25, 2017, 5:16am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/19 "2017-10-25T05:16:09Z")

</div>

> [@PinkiMondal](#):
>
> I guess m getting this problem because my machine is out of disk space

Yes, that would make sense.

---

<div class="post-metadata">

**Author:** ![PinkiMondal](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@PinkiMondal](https://discuss.elastic.co/u/PinkiMondal)\
**Post date:** [October 25, 2017, 5:17am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/20 "2017-10-25T05:17:11Z")

</div>

Do i need to enable more nodes to allocate shards other than primary one

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [October 25, 2017, 5:20am UTC](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034/21 "2017-10-25T05:20:09Z")

</div>

Yes, for resolving allocation issue you have to enable one more node at least i.e good to configure elasticsearch cluster for distributing shards among them removing disk space.  
also you can refer below link:

> **[Modern monitoring & analytics](https://www.datadoghq.com/blog/elasticsearch-unassigned-shards/)**
>
> See metrics from all of your apps, tools & services in one place with Datadog's cloud monitoring as a service solution. Try it for free.

[Next page](https://discuss.elastic.co/t/how-many-records-a-shard-can-have/105034.md?page=2)
