一、背景
7.7.1 版本的压测报告
二、准备
-
y3 kp selection ES集群
| 单元 | 应用名 | 主机IP | 配置 | CPU主频 | 监控 |
|---|---|---|---|---|---|
| yumc3(ksa) | kp | 172.25.162.36 | 16C/32G/200G | 2.30GHz | |
| kp | 172.25.162.38 | 16C/32G/200G | 2.30GHz | ||
| kp | 172.25.162.39 | 16C/32G/200G | 2.30GHz | ||
| kp | 172.25.162.41 | 16C/32G/200G | 2.30GHz | ||
| kp | 172.25.162.44 | 16C/32G/200G | 2.30GHz | ||
| kp | 172.25.162.46 | 16C/32G/200G | 2.30GHz |
-
安装包
-
升级时间2025.04.14 晚上22点
四、升级操作
-
【DBA】传递安装包
# 传递rpm包
2. ## 【TSC】清空流量
-
【DBA】停止6个节点的es服务
172.25.162.36
172.25.162.38
172.25.162.39
172.25.162.41
172.25.162.44
172.25.162.46
#
systemctl stop elasticsearch
4. ## 【DBA】备份762的数据配置
# 备份elasticsearch数据路径
mv /data/elasticsearch /data/elasticsearch_762_250414bak
# 创建新的elasticsearch路径
mkdir /data/elasticsearch
chown -R elasticsearch.elasticsearch /data/elasticsearch
5. ## 【DBA】备份762的配置文件
# 备份2个配置文件
cp /etc/elasticsearch/elasticsearch.yml /root/elasticsearch.yml_762_250414bak
cp /etc/elasticsearch/jvm.options /root/jvm.options_762_250414bak
6. ## 【DBA】安装es771服务
# 安装
rpm -i /root/elasticsearch-7.7.1-x86_64.rpm
# 创建es的数据目录和日志目录
mkdir -p /data/elasticsearch/{data,backup,log}
# 权限调整
chown -R elasticsearch:elasticsearch /data/elasticsearch
# 删除log4j多余的jar包
rm -rf /usr/share/elasticsearch/lib/log4j-api-2.11.1.jar
rm -rf /usr/share/elasticsearch/lib/log4j-core-2.11.1.jar
rm -rf /usr/share/elasticsearch/modules/x-pack-core/log4j-1.2-api-2.11.1.jar
7. ## 【DBA】配置新版本es的es配置文件
vi /etc/elasticsearch/elasticsearch.yml
# 172.25.162.36
cluster.name: kp_selection_ksa
node.name: master01
node.master: true
node.data: true
node.ingest: true
node.ml: true
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/log
path.repo: ["/data/elasticsearch/backup"]
network.host: 172.25.162.36
http.port: 9200
discovery.seed_hosts: ["172.25.162.36","172.25.162.38","172.25.162.39"]
cluster.initial_master_nodes: ["172.25.162.36","172.25.162.38","172.25.162.39"]
# 172.25.162.38
cluster.name: kp_selection_ksa
node.name: master02
node.master: true
node.data: true
node.ingest: true
node.ml: true
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/log
path.repo: ["/data/elasticsearch/backup"]
network.host: 172.25.162.38
http.port: 9200
discovery.seed_hosts: ["172.25.162.36","172.25.162.38","172.25.162.39"]
cluster.initial_master_nodes: ["172.25.162.36","172.25.162.38","172.25.162.39"]
# 172.25.162.39
cluster.name: kp_selection_ksa
node.name: master03
node.master: true
node.data: true
node.ingest: true
node.ml: true
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/log
path.repo: ["/data/elasticsearch/backup"]
network.host: 172.25.162.39
http.port: 9200
discovery.seed_hosts: ["172.25.162.36","172.25.162.38","172.25.162.39"]
cluster.initial_master_nodes: ["172.25.162.36","172.25.162.38","172.25.162.39"]
# 172.25.162.41
cluster.name: kp_selection_ksa
node.name: KSSHMW149699
node.master: false
node.data: true
node.ingest: true
node.ml: true
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/log
path.repo: ["/data/elasticsearch/backup"]
network.host: 172.25.162.41
http.port: 9200
discovery.seed_hosts: ["172.25.162.36","172.25.162.38","172.25.162.39"]
cluster.initial_master_nodes: ["172.25.162.36","172.25.162.38","172.25.162.39"]
# 172.25.162.44
cluster.name: kp_selection_ksa
node.name: KSSHMW149702
node.master: false
node.data: true
node.ingest: true
node.ml: true
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/log
path.repo: ["/data/elasticsearch/backup"]
network.host: 172.25.162.44
http.port: 9200
discovery.seed_hosts: ["172.25.162.36","172.25.162.38","172.25.162.39"]
cluster.initial_master_nodes: ["172.25.162.36","172.25.162.38","172.25.162.39"]
# 172.25.162.46
cluster.name: kp_selection_ksa
node.name: KSSHMW149704
node.master: false
node.data: true
node.ingest: true
node.ml: true
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/log
path.repo: ["/data/elasticsearch/backup"]
network.host: 172.25.162.46
http.port: 9200
discovery.seed_hosts: ["172.25.162.36","172.25.162.38","172.25.162.39"]
cluster.initial_master_nodes: ["172.25.162.36","172.25.162.38","172.25.162.39"]
8. ## 【DBA】修改jvm,使用G1,jvm size=16G
#
vim /etc/elasticsearch/jvm.options
9. ## 【DBA】安装插件
# IK 分词器
/usr/share/elasticsearch/bin/elasticsearch-plugin install file:///root/elasticsearch-analysis-ik-7.7.1.zip
10. ## 【DBA】启动ES集群
#
systemctl restart elasticsearch
#
systemctl start elasticsearch
#
systemctl enable elasticsearch
11. ## 【DBA】验证
#
curl http://172.25.162.36:9200/_cat/nodes?v
#
curl http://172.25.162.36:9200/_cat/plugins?v
#
curl http://172.25.162.36:9200/_cluster/health?pretty
#
12. ## 【开发】执行同步job,将数据导入新集群
-
【开发】等待开发验证
-
【TSC】启动应用
-
【TSC】引流
-
完成
五、回滚方案
-
停止升级动作
-
恢复原版本的ES服务,并且恢复ES集群