Created
March 7, 2018 21:33
-
-
Save portante/9b173a137aae335b341cbd5585a3b992 to your computer and use it in GitHub Desktop.
A simple script to move a replica shard from one node to another in an OpenShift ES cluster.
This file contains hidden or 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
| #!/bin/bash | |
| ES_URL='https://localhost:9200' | |
| curl_post='curl -s -X POST --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
| date | |
| $curl_post $ES_URL/_cluster/reroute?pretty=true -d "{ \"commands\" : [ { \"move\" : { \"index\" : \"$1\", \"shard\" : $2, \"from_node\" : \"$3\", \"to_node\" : \"$4\" } } ] }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment