Help Center/ Cloud Search Service/ Troubleshooting/ Functions/ Error Message "maximum shards open" Is Displayed When Users Try to Create an Index
Updated on 2025-01-23 GMT+08:00

Error Message "maximum shards open" Is Displayed When Users Try to Create an Index

Symptom

When users try to create an index, an error message is displayed: "this action would add [2] total shards, but this cluster currently has [1000]/[1000] maximum shards open".

Possible Cause

By default, each node can support a maximum of 1000 shards. An error is reported when this limit is exceeded.

Solution

  • Solution 1: Disable or delete unused indexes to reduce the number of shards.
  • Solution 2: Change the limit on the maximum number of shards per node. For details, see max_shards_per_node.
    PUT _cluster/settings
    {
      "persistent": {
        "cluster": {
          "max_shards_per_node": 2000
        }
      }
    }

Changing the limit on the maximum number of shards per node is just a temporary fix. To solve this issue in the long term, aim for 20 shards or fewer per GB of JVM heap memory (each node should have a heap memory size that is 50% of the node's available memory, up to 31 GB). For more information, see shard count recommendation.