Last active
March 7, 2018 21:32
-
-
Save portante/e09e0d2f63903f6b2fb1d48f39a6ab53 to your computer and use it in GitHub Desktop.
A simple script to "allocate" a primary shard on an particular OpenShift pod ES cluster member.
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\" : [ { \"allocate\" : { \"index\" : \"$2\", \"shard\" : 0, \"node\" : \"$1\", \"allow_primary\": \"true\" } } ] }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment