Last active
March 1, 2018 08:38
-
-
Save duboisph/e150d3bd7b424d1ddb07fc9ebed26efa to your computer and use it in GitHub Desktop.
Reconfigure single node Elasticsearch replicas
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
#!/bin/bash | |
ES=$1 | |
curl -s -XPUT ${ES}/_template/default -H 'Content-Type: application/json' -d '{ "order": 0, "template": "*", "settings": { "number_of_replicas": 0 }}' | |
echo | |
IFS=$'\n' | |
for line in $(curl -s ${ES}/_cat/indices?v 2> /dev/null); do | |
INDEX=$(echo $line | (awk '{print $3;}')) | |
curl -s -XPUT ${ES}/${INDEX}/_settings -H 'Content-Type: application/json' -d '{ "index" : { "number_of_replicas" : 0 } }' | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment