参考

https://cloud.tencent.com/developer/article/1763280

  • 修改分片平衡策略
  • 停止要升级的节点
  • 修改jvm内存配置
  • 关机
  • 升配
  • 开机
  • 恢复分片平衡策略

步骤

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20

es_node=localhost:9200
curl -XGET $es_node/_cluster/health?pretty
curl -XGET $es_node/_cluster/settings?pretty
curl -H "Content-Type: application/json" -XPUT $es_node/_cluster/settings -d '
{
    "transient" : {
        "cluster.routing.allocation.enable" : "none"
    }
}
'

# 所有节点执行完升级可以恢复下面的配置,all或者null都行
curl -H "Content-Type: application/json" -XPUT $es_node/_cluster/settings -d '
{
    "transient" : {
        "cluster.routing.allocation.enable" : null
    }
}
'