Last active
April 5, 2018 11:03
-
-
Save portante/fc2f81a6e0a56db545cbdf1aa5f73c3b to your computer and use it in GitHub Desktop.
A simple script to set the replica count for all indices to 1.
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_put='curl -s -X PUT --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
$curl_put $ES_URL/${1}/_settings?pretty -d '{ "index" : { "auto_expand_replicas" : "false" } }' | |
$curl_put $ES_URL/${1}/_settings?pretty -d '{ "index" : { "number_of_replicas" : 1 } }' |
Author
portante
commented
Apr 5, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment