# Cannot increase total shards

**URL:** https://discuss.elastic.co/t/cannot-increase-total-shards/358257
**Category:** Elasticsearch
**Created:** [April 26, 2024, 5:17am UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257 "2024-04-26T05:17:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![My\_Google\_Account](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/my_google_account/32/55185_2.png) [@My\_Google\_Account](https://discuss.elastic.co/u/My_Google_Account)
#### Post date: [April 26, 2024, 5:17am UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257/1 "2024-04-26T05:17:17Z")

</div>

Hello there, we have 3 data nodes with 7.6.1 elk version and before we add the new nodes in our cluster we want to increase the amount of shards for each node and we did it with the following directives:

```auto

{
  "persistent" : {
    "cluster" : {
      "routing" : {
        "allocation" : {
          "total_shards_per_node" : "1300"
      
      
and in: /etc/elasticsearch/elasticsearch.yml
      cluster.max_shards_per_node: 1300

```

but nothing happened, system show that [2999]/[3000] maximum shards open;  
what is the right way to increase it? thanks.

---

<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: [April 26, 2024, 5:21am UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257/2 "2024-04-26T05:21:33Z")

</div>

The setting to use is [cluster.max\_shards\_per\_node](https://www.elastic.co/guide/en/elasticsearch/reference/8.13/misc-cluster-settings.html#cluster-shard-limit). Be aware that the limit is there for a good reason and I would consider it quite high. If you have a lot of small indices/shards I would recommend you look into changing your sharding practices. Have a look at [this old blog post](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster) for further details.

Note that shard handling has been improved in recent versions so I would recommend you upgrade to the very latest version of Elasticsearch.

---

<div class="post-metadata">

### Author: ![My\_Google\_Account](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/my_google_account/32/55185_2.png) [@My\_Google\_Account](https://discuss.elastic.co/u/My_Google_Account)
#### Post date: [April 26, 2024, 11:09am UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257/3 "2024-04-26T11:09:57Z")

</div>

thanks you for this article, i understood that amount of shards depends of heap size, but still have a question, how this setting: cluster.max\_shards\_per\_node will be correlate with it? i mean if i want to increase max shards on each node - i should only increase heap size for example +10GB and this settings can be omit?

---

<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: [April 26, 2024, 11:24am UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257/4 "2024-04-26T11:24:25Z")

</div>

If you follow the guidelines in the blog post 1000 shards per node should be sufficient, so you should not need to increase it. You can increase the setting without adding heap. It is a guideline, not a hard rule, aimed at preventing oversharding, which can be very inefficient and eventually cause a lot of problems that it may be hard to recover from down the line.

---

<div class="post-metadata">

### Author: ![My\_Google\_Account](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/my_google_account/32/55185_2.png) [@My\_Google\_Account](https://discuss.elastic.co/u/My_Google_Account)
#### Post date: [April 26, 2024, 11:56am UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257/5 "2024-04-26T11:56:56Z")

</div>

in my case only adding new nodes can solve my problem, am i right? without modify elasticsearch.yml and heap size.

---

<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: [April 26, 2024, 11:59am UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257/6 "2024-04-26T11:59:28Z")

</div>

Yes.

---

<div class="post-metadata">

### Author: ![My\_Google\_Account](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/my_google_account/32/55185_2.png) [@My\_Google\_Account](https://discuss.elastic.co/u/My_Google_Account)
#### Post date: [April 26, 2024, 12:15pm UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257/7 "2024-04-26T12:15:44Z")

</div>

thanks for your fast answers

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 26, 2024, 1:39pm UTC](https://discuss.elastic.co/t/cannot-increase-total-shards/358257/8 "2024-04-26T13:39:53Z")

</div>

Another option is to reduce the number of shards.

What is the output of:

```auto
GET /
GET /_cat/nodes?v
GET /_cat/health?v
GET /_cat/indices?v

```

If some outputs are too big, please share them on [gist.github.com](http://gist.github.com) and link them here.
