Last active
May 18, 2018 12:24
-
-
Save portante/516de6542a8a99432fb62c578d320030 to your computer and use it in GitHub Desktop.
A simple script to set the replica count of all indices to 0
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" : 0 } }' |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that the Elasticsearch cluster will go yellow until the replica shards are created and sync'd.