Max Shards Per Node Exceeded
Severity:
High
Elasticsearch Version:
8.5.0
Problem
Cluster refuses index creation due to exceeding maximum shards per node limit
Root Cause
Excessive shard count per node caused by high index creation rate or insufficient shard management
How to Detect
Symptoms
- Index creation failures with shard limit errors
- Cluster health shows yellow or red status
- Shard allocation failures in logs
Commands
GET /_cat/shards?v
GET /_cluster/health
GET /_cluster/allocation/explain
Remediation Steps
- Identify and delete unused or unnecessary indices
- Reindex large indices with fewer shards
- Adjust index settings to reduce shard count
- Update cluster settings to increase max shards per node if appropriate
- Monitor shard distribution and cluster health
Prevention
- Implement shard planning during index creation
- Set appropriate shard count based on node capacity
- Regularly monitor shard distribution and cluster health
- Automate index lifecycle management to prevent shard explosion
Production Example
curl -XPUT 'http://localhost:9200/_cluster/settings' -H 'Content-Type: application/json' -d '{"persistent": {"cluster.max_shards_per_node": 1000}}'