Full cluster restart upgrade
Disable shard allocation
1
2
3
4
5
6curl -XPUT 'localhost:9200/_cluster/settings?pretty' -d'
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}'Perform a synced flush
1
curl -XPOST 'localhost:9200/_flush/synced?pretty'
Shutdown and upgrade all nodes
1
Stop all Elasticsearch services on all nodes in the cluster
Upgrade any plugins
1
2Elasticsearch plugins must be upgraded when upgrading a node.
Use the elasticsearch-plugin script to install the correct version of any plugins that you need.Start the cluster
1
2
3If you have dedicated master nodes — nodes with node.master set to true(the default) and node.data set to false — then it is a good idea to start them first.
curl -XGET 'localhost:9200/_cat/health?pretty'
curl -XGET 'localhost:9200/_cat/nodes?pretty'Wait for yellow
1
As soon as each node has joined the cluster, it will start to recover any primary shards that are stored locally.
Reenable allocation
1
2
3
4
5
6
7
8
9curl -XPUT 'localhost:9200/_cluster/settings?pretty' -d'
{
"persistent": {
"cluster.routing.allocation.enable": "all"
}
}'
curl -XGET 'localhost:9200/_cat/health?pretty'
curl -XGET 'localhost:9200/_cat/recovery?pretty'