# README
Elasticsearch Cluster Cleanup Script
Warning this attempts a potentially destructive action. Do not run on an Elasticsearch cluster where you cannot accept data loss.
This script will attempt to bring a Yellow Elasticsearch cluster back to green by cleaning up large indices/data streams by:
- Finding all data streams larger than the given
max-size-bytes
flag. - Rolling over these data streams to new internal indices.
- Deleting the old large index. (This is destructive. Do not run this on an Elasticsearch cluster where you can't lose the old data in these indices)
- Finally calling
_cluster/reroute
to attempt to reroute any pending failed shards.
Building the tool
make build
Running the tool
# cleans up indices larger than 100MB
./bin/cleanup -p your-password -u your-username -m 104857600