Skip to content

Instantly share code, notes, and snippets.

View ckorobov's full-sized avatar

Constantine ckorobov

View GitHub Profile
HOST=YOUR_ES_HOST
PORT=YOUR_ES_PORT
TO_NODE=DESTINATION_NODE_NAME
curl "http://$HOST:$PORT/_cat/shards" | grep UNAS | awk '{print $1,$2}' | while read var_index var_shard; do
curl -XPOST "http://$HOST:$PORT/_cluster/reroute" -d "
{
\"commands\" : [
{
\"allocate\" :