# ElasticsearchException: failed to create index [logs-2025.03] - this action would add [2] shards, but this cluster currently has [1000]/[1000] maximum shards open

- **ID:** `elasticsearch/shard-limit-exceeded-for-node`
- **Domain:** elasticsearch
- **Category:** resource_error
- **Error Code:** `shard_limit_exceeded`
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

The cluster has reached the maximum number of shards allowed, preventing the creation of new indices.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Elasticsearch 7.17.0 | active | — | — |
| Elasticsearch 8.11.0 | active | — | — |
| Elasticsearch 8.15.0 | active | — | — |

## Workarounds

1. **Reduce the number of shards per index by reindexing with fewer primary shards. For example, use `POST /_reindex` with a target index that has 1 primary shard instead of 5: `{"source": {"index": "logs-2025.03"}, "dest": {"index": "logs-2025.03-compact", "number_of_shards": 1}}`** (85% success)
   ```
   Reduce the number of shards per index by reindexing with fewer primary shards. For example, use `POST /_reindex` with a target index that has 1 primary shard instead of 5: `{"source": {"index": "logs-2025.03"}, "dest": {"index": "logs-2025.03-compact", "number_of_shards": 1}}`
   ```
2. **Increase `cluster.max_shards_per_node` cautiously after auditing shard distribution. Run `GET _cluster/settings` to check current limit, then set via `PUT _cluster/settings` with `{"persistent": {"cluster.max_shards_per_node": 1500}}`. Ensure enough heap per node.** (72% success)
   ```
   Increase `cluster.max_shards_per_node` cautiously after auditing shard distribution. Run `GET _cluster/settings` to check current limit, then set via `PUT _cluster/settings` with `{"persistent": {"cluster.max_shards_per_node": 1500}}`. Ensure enough heap per node.
   ```

## Dead Ends

- **** — This only delays the problem and can cause severe performance degradation because each node handles too many shards, leading to heap pressure and slow recovery. (70% fail)
- **** — Deleting indices may not free up shard slots if the cluster-level limit is still hit due to node distribution; also risks data loss. (45% fail)
