# Unable to increase shard allocation limit

**URL:** <https://discuss.elastic.co/t/unable-to-increase-shard-allocation-limit/221884>\
**Category:** Elasticsearch\
**Created:** [March 3, 2020, 12:45pm UTC](https://discuss.elastic.co/t/unable-to-increase-shard-allocation-limit/221884 "2020-03-03T12:45:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yashwant\_Shettigar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yashwant_shettigar/32/47652_2.png) [@Yashwant\_Shettigar](https://discuss.elastic.co/u/Yashwant_Shettigar)\
**Post date:** [March 3, 2020, 12:45pm UTC](https://discuss.elastic.co/t/unable-to-increase-shard-allocation-limit/221884/1 "2020-03-03T12:45:42Z")

</div>

Hello,

I am upgrading my ELK stack from 6.8 version to 7.5. While upgrading, I am getting following error in elasticsearch :

"Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [1207]/[1000] maximum shards open;"

I tried to increase the shard limit by adding below line in elasticsearch.yml file :

cluster.max\_shards\_per\_node: 3000

But even after restarting the elasticsearch service, settings are not reflecting and it shows same error.

Thank You

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [March 3, 2020, 1:43pm UTC](https://discuss.elastic.co/t/unable-to-increase-shard-allocation-limit/221884/2 "2020-03-03T13:43:27Z")

</div>

Hi,

I think you are running into this problem: [https://github.com/elastic/elasticsearch/issues/40803](https://github.com/elastic/elasticsearch/issues/40803)

Can you try to set the limit using the persistent settings API and then try if the error still occurs after restarting? [https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html)

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![Yashwant\_Shettigar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yashwant_shettigar/32/47652_2.png) [@Yashwant\_Shettigar](https://discuss.elastic.co/u/Yashwant_Shettigar)\
**Post date:** [March 4, 2020, 6:31am UTC](https://discuss.elastic.co/t/unable-to-increase-shard-allocation-limit/221884/3 "2020-03-04T06:31:26Z")

</div>

Hi Wolfram,

Tried these settings, but still it is not reflecting. Also, tried by restarting elasticsearch service.

Is there anyway to delete shards from backend ?

Thank You

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [March 4, 2020, 7:39am UTC](https://discuss.elastic.co/t/unable-to-increase-shard-allocation-limit/221884/4 "2020-03-04T07:39:20Z")

</div>

Hi,

I don't know if you would really want to **delete** shards but depending on your setup you could reduce the number of shards:  
If you have time-based indexes, e.g. daily you could reindex your indexes into weekly or monthly indexes: [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)  
If you have multiple primary shards for a single index you could shrink your index and thereby reducing the number of primary shards: [https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-shrink-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-shrink-index.html)  
If you have multiple replica shards you can change that while shrinking too by setting index.number\_of\_replicas.

Best regards  
Wolfram

---

<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:** [April 1, 2020, 7:39am UTC](https://discuss.elastic.co/t/unable-to-increase-shard-allocation-limit/221884/5 "2020-04-01T07:39:26Z")

</div>

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