# Number of Shards open Issue - 7.0.1

**URL:** <https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785>\
**Category:** Elasticsearch\
**Created:** [May 13, 2019, 10:20am UTC](https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785 "2019-05-13T10:20:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmcdowell03](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cmcdowell03/32/36369_2.png) [@cmcdowell03](https://discuss.elastic.co/u/cmcdowell03)\
**Post date:** [May 13, 2019, 10:20am UTC](https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785/1 "2019-05-13T10:20:06Z")

</div>

I am attempting to upgrade from 6.\* to 7.0.1 and noticed there is a hard limit set for shards.

My question is, is there any advice for limiting Shards open or re-configuring this limit?

Per the documentation, the limit seems to be unbound, not sure if that is the case at this point.  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/allocation-total-shards.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/allocation-total-shards.html)

The Error below shows a hard limit of 1000 shards set for 7.0.1

unexpected error while indexing monitoring document  
org.elasticsearch.xpack.monitoring.exporter.ExportException: [.monitoring-es-7-2019.05.09] IndexCreationException[failed to create index [.monitoring-es-7-2019.05.09]]; nested: ValidationException[Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [5044]/[1000] maximum shards open;];

Thank you

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 14, 2019, 6:37am UTC](https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785/2 "2019-05-14T06:37:45Z")

</div>

The limit you are hitting is [`cluster.max_shards_per_node`](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/misc-cluster.html#cluster-shard-limit). I think it's right, you probably should try and reduce the number of shards in this cluster. Here is an article with more info:

> **[How many shards should I have in my Elasticsearch cluster?](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster)**
>
> If you are looking for practical guidelines around how many indices and shards to have in your cluster, this blog post will help you avoid common pitfalls.

---

<div class="post-metadata">

**Author:** ![cmcdowell03](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cmcdowell03/32/36369_2.png) [@cmcdowell03](https://discuss.elastic.co/u/cmcdowell03)\
**Post date:** [May 14, 2019, 7:26am UTC](https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785/3 "2019-05-14T07:26:21Z")

</div>

Thank you @DavidTurner for the replay,  
Would you have any recommendations on how to start up the 7.0.1 node so I can manage the cluster? This is not a production environment and I was attempting to move up to 7.0 for testing. My problem is I can't get Kibana up and running to get in an manage the API due to Kibana needing to create new index templates. I understand I could go the route of sending Curl commands but I'd rather manage it from the UI.  
Thank you - Cody

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 14, 2019, 7:49am UTC](https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785/4 "2019-05-14T07:49:52Z")

</div>

Yes, as a temporary measure, until you get the number of shards under control, you can add `cluster.max_shards_per_node: 5100` to your `elasticsearch.yml` config file.

---

<div class="post-metadata">

**Author:** ![cmcdowell03](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cmcdowell03/32/36369_2.png) [@cmcdowell03](https://discuss.elastic.co/u/cmcdowell03)\
**Post date:** [May 14, 2019, 8:02am UTC](https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785/5 "2019-05-14T08:02:46Z")

</div>

@DavidTurner  
Interesting, I had tried that already and was still getting the same alarm  
I can't seem to figure out how to set that `cluster.max_shards_per_node: 5100`

I have tried cluster.max\_shards\_per\_node: 5100 in `elasticsearch.yml`  
and  
`$ES_HOME\bin\elasticsearch -Ecluster.max_shards_per_node=5100` with no luck （；＿；）

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 14, 2019, 9:11am UTC](https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785/6 "2019-05-14T09:11:43Z")

</div>

Ok, confusingly this setting is _only_ a dynamic setting right now, so the values from `elasticsearch.yml` and the command line are both ignored. I think this is a bug and opened [#42137](https://github.com/elastic/elasticsearch/issues/42137).

In the meantime you can set it dynamically on a running Elasticsearch cluster with the following curl command

```auto
curl -XPUT $CLUSTER_URL/_cluster/settings -H 'Content-type: application/json' --data-binary $'{"transient":{"cluster.max_shards_per_node":5100}}'

```

---

<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:** [June 11, 2019, 9:11am UTC](https://discuss.elastic.co/t/number-of-shards-open-issue-7-0-1/180785/7 "2019-06-11T09:11:53Z")

</div>

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