Skip to content

Instantly share code, notes, and snippets.

@ozbillwang
Last active August 29, 2015 14:08
Show Gist options
  • Save ozbillwang/06b3a418018743efa39d to your computer and use it in GitHub Desktop.
Save ozbillwang/06b3a418018743efa39d to your computer and use it in GitHub Desktop.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cat.html

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html


Take one elasticsearch box (in AWS cloud) of the cluster (for example, maintenance jobs such as upgrade and reboot the box): http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-cluster.html

curl -XPUT localhost:9200/_cluster/settings -d '{
    "transient" : {
        "cluster.routing.allocation.exclude._ip" : "10.0.0.1"
    }
}'

Another way

curl -XPUT localhost:9200/_cluster/settings -d '{ 
     "transient" :{ 
          "cluster.routing.allocation.exclude.name" : "ip-10-01-1-23_i-416a2d7e"
          }
}'

Notes:

1. You need AWS plug-in for elasticsearch.
2. when do the maintenance, you need take one box off the cluster, this curl command will be useful.
3. replace "localhost" to your logstash load banancer dns name,  "10.0.0.1" to the real ip address, or "ip-10-01-1-23_i-416a2d7e" to real aws instance id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment