{
  "id": "elasticsearch/shards-limit-exceeded",
  "signature": "ElasticsearchException: failed to create index [my_index] - limit of total shards [1000] for cluster [my_cluster] exceeded",
  "signature_zh": "ElasticsearchException: 创建索引 [my_index] 失败 - 集群 [my_cluster] 的分片总数限制 [1000] 已超出",
  "regex": ".*failed to create index.*limit of total shards.*exceeded.*",
  "domain": "elasticsearch",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The cluster has reached its maximum allowed number of shards (default 1000 per node or cluster-level limit), preventing index creation or opening.",
  "root_cause_type": "generic",
  "root_cause_zh": "集群已达到允许的最大分片数量（默认每节点或集群级别限制为1000），阻止索引创建或打开。",
  "versions": [
    {
      "version": "7.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "7.17.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Shard counts are persisted in cluster state and metadata, not reset on restart; this only causes temporary downtime without fixing the limit.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The limit applies to the entire cluster, not just one index. Deleting a single index does not free enough shards if the cluster is at capacity.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding replicas increases total shard count, making the problem worse. The limit caps total shards including replicas.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the cluster-level shard limit dynamically: PUT _cluster/settings { \"persistent\": { \"cluster.max_shards_per_node\": 2000 } }",
      "success_rate": 0.85,
      "how": "Increase the cluster-level shard limit dynamically: PUT _cluster/settings { \"persistent\": { \"cluster.max_shards_per_node\": 2000 } }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce shard count by merging small indices or deleting unused indices: POST _cat/indices?v | awk '{print $3}' | xargs -I {} curl -XDELETE 'http://localhost:9200/{}'",
      "success_rate": 0.8,
      "how": "Reduce shard count by merging small indices or deleting unused indices: POST _cat/indices?v | awk '{print $3}' | xargs -I {} curl -XDELETE 'http://localhost:9200/{}'",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set a per-index shard limit to prevent future overflow: PUT _cluster/settings { \"persistent\": { \"cluster.max_shards_per_node.frozen\": 500 } }",
      "success_rate": 0.75,
      "how": "Set a per-index shard limit to prevent future overflow: PUT _cluster/settings { \"persistent\": { \"cluster.max_shards_per_node.frozen\": 500 } }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase the cluster-level shard limit dynamically: PUT _cluster/settings { \"persistent\": { \"cluster.max_shards_per_node\": 2000 } }",
    "Reduce shard count by merging small indices or deleting unused indices: POST _cat/indices?v | awk '{print $3}' | xargs -I {} curl -XDELETE 'http://localhost:9200/{}'",
    "Set a per-index shard limit to prevent future overflow: PUT _cluster/settings { \"persistent\": { \"cluster.max_shards_per_node.frozen\": 500 } }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/misc-cluster-settings.html#cluster-shard-limit",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2023-05-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}