Cluster has already maximum shards open

Aside from the answers mentioned above, you can also try increasing the shards until you try to rearchitect the nodes

curl -X PUT localhost:9200/_cluster/settings -H "Content-Type: application/json" -d '{ "persistent": { "cluster.max_shards_per_node": "3000" } }'

Besides, the following can be useful the should be proceeded with CAUTION ofcourse

  • Get total number of unassigned shards in cluster
curl -XGET -u elasticuser:yourpassword http://localhost:9200/_cluster/health\?pretty | grep unassigned_shards

USE WITH CAUTION

  • To DELETE the unassigned shards in a cluster (USE WITH CAUTION)
curl -XGET -u elasticuser:yourpassword http://localhost:9200/_cat/shards | grep UNASSIGNED | awk {'print $1'} #(USE WITH CAUTION) | xargs -i curl  -XDELETE -u elasticuser:yourpassword "http://localhost:9200/{}"

Leave a Comment