Skip to content

Instantly share code, notes, and snippets.

@portante
Last active March 9, 2018 22:09
Show Gist options
  • Select an option

  • Save portante/929c983e0aa77cb57c7e451b621dc954 to your computer and use it in GitHub Desktop.

Select an option

Save portante/929c983e0aa77cb57c7e451b621dc954 to your computer and use it in GitHub Desktop.
Enable/disable shard allocation in an OpenShift Elasticsearch cluster.
#!/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'
date
$curl_put $ES_URL/_cluster/settings?pretty -d "{ \"transient\" : { \"cluster.routing.allocation.enable\" : \"$1\" } }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment