Last active
June 8, 2017 08:53
-
-
Save FreeTymeKiyan/21a50205ede3774a90156ffc8057f3e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\" : | |
{ | |
\"index\" : \"$var_index\", | |
\"shard\" : $var_shard, | |
\"node\" : \"$TO_NODE\", | |
\"allow_primary\" : true | |
} | |
} | |
] | |
}" ; | |
sleep 5; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment