操作步骤:
1. Disable shard allocation
curl -XPUT 'localhost:9200/_cluster/settings?pretty' -d '
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}'2. Perform a synced flush
curl -XPOST 'localhost:9200/_flush/synced?pretty'
3. Shutdown and upgrade all nodes
4. Upgrade any plugins
5. Start the cluster
建议优先启动
node.master
:true,
node.data:
false的节点,用
curl -XGET 'localhost:9200/_cat/health?pretty'
curl -XGET 'localhost:9200/_cat/nodes?pretty'命令确认所有节点加入集群
6. Wait for yellow
用
curl -XGET 'localhost:9200/_cat/health?pretty'
命令确认集群所处于yellow状态
7. Reenable allocation
curl -XPUT 'localhost:9200/_cluster/settings?pretty' -d '
{
"persistent": {
"cluster.routing.allocation.enable": "all"
}
}'
完成
官方链接:
https://www.elastic.co/guide/en/elasticsearch/reference/current/restart-upgrade.html