集群节点Elasticsearch升级
集群节点Elasticsearch升级
- 操作流程
1.首先执行Elasticsearch-1.2.2集群的索引数据备份
2.关闭elasticsearch-1.2.2集群的recovery.compress
curl -XPUT "http://localhost:9200/_cluster/settings" -d'
{
"persistent": {
"indices.recovery.compress": false
}
}'
3.关闭shard reallocation
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.enable" : "none"
}
}'
4.关闭集群中需要升级的节点
curl -XPOST 'http://localhost:9200/_cluster/nodes/_local/_shutdown'
5.确认被关闭节点上的分片正确重新分配到集群中还在运行的节点上
6.在服务器上安装好elasticsearch-1.5.2的实例, 将elasticsearch-1.2.2实例的配置文件覆盖elasticsearch-1.5.2的配置文件; 同时elasticsearch-1.5.2节点的data目录和elasticsearch-1.2.2的data目录做一个symbolic link:
cp /app/IDC/KT-ES/elasticsearch-1.2.2-data/config/* ./config/
cp -r /app/IDC/KT-ES/elasticsearch-1.2.2-master/bin/service* ./bin/service
ln -s /app/IDC/KT-ES/elasticsearch-1.2.2-data/data/ ./data
7.启动新升级的elasticsearch-1.5.2节点,确认其正常加入cluster
8.恢复分片的reallocation
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.enable" : "all"
}
}'
9.观察所有分片可能在所有的节点上allocated。分片balance会花费一些时间
10.针对所有剩下的节点,重复上述操作步骤。
11.待所有节点操作完成后,执行如下命令:
curl -XPUT localhost:9200/_cluster/settings -d '{
"persistent" : {
"cluster.routing.allocation.disable_allocation" : true
}
}
同时整个集群进行重启;
12.待所有节点操作完成后,打开indices.recovery.compress,同时整个集群进行重启。
标签:
elasticsearch
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」