Last active
August 29, 2015 13:56
-
-
Save markwalkom/8972803 to your computer and use it in GitHub Desktop.
Elasticsearch - restarting and recovering
This file contains 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
## For a node | |
This tells ES to not move shards around if a node/nodes drops out of the cluster; | |
`curl -XPUT eshost.example.com:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": none}}'` | |
`sudo service elasticsearch restart` | |
`curl -XPUT eshost.example.com:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": all}}'` | |
When you are done and the node/nodes are back, they will reinitialise their local shards and you're cluster should be back to green as fast as the local node can work. | |
## For a cluster | |
You can also speed a full cluster restart by settings the following config settings - *gateway.recover_after_nodes* and *gateway.expected_nodes* - preferably to the number of nodes in the cluster. This way when a cluster comes back it won't start recovery until it can see the numbers specified and when it does it will use local data as much as possible. | |
Finally you can set *index.recovery.concurrent_streams*, this requires a bit of testing to make sure you don't overwhelm your node, but if you can increase that from the default of 3 to something higher. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment