Skip to content

Instantly share code, notes, and snippets.

@portante
Created June 21, 2017 22:34
Show Gist options
  • Select an option

  • Save portante/4771e05f95b0f7b175fef13ee8a6b2d4 to your computer and use it in GitHub Desktop.

Select an option

Save portante/4771e05f95b0f7b175fef13ee8a6b2d4 to your computer and use it in GitHub Desktop.
A simple script to turn off "auto_expand_replicas" setting for each index.
#!/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/*/_settings -d '{ "index" : { "auto_expand_replicas" : false } }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment