DAPE.work

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

  1. Identify and delete unused or unnecessary indices
  2. Reindex large indices with fewer shards
  3. Adjust index settings to reduce shard count
  4. Update cluster settings to increase max shards per node if appropriate
  5. 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}}'