Skip to content

Instantly share code, notes, and snippets.

@fdv
Last active January 4, 2016 21:59
Show Gist options
  • Save fdv/8684552 to your computer and use it in GitHub Desktop.
Save fdv/8684552 to your computer and use it in GitHub Desktop.
In case your Elasticsearch cluster goes red and refuses to assign some shards anymore...
# Seems you have 2 solutions left:
# - either you trash the whole index and reindex. Good luck, have fun
# - or you manually reallocate the whole thing
#
# Guess what I'll pick up
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands": [
{
"allocate": {
"index": "YOURFUCKINGINDEX",
"shard": YOURBLOODYSHARD,
"node": "ANYFUCKINGDATANODE",
"allow_primary": 1
}
}
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment