准备升级至v5.7.0之前的操作
创建时间:2024-04-17 最近修改时间:2024-04-17
#1. 准备升级至v5.7.0之前的操作
- 升级deepflow-release
# 挂载镜像
mount -o ro xxxx.iso /media/
# 执行升级
yum --disablerepo=* -y install /media/deepflow-release-*.rpm
1
2
3
4
2
3
4
#2. 准备升级至v5.7.3之前的操作
#2.1 备份MySQL数据
# 如本机没有 mysql,可使用 mntnct 或 mysql pod 执行
mysqldump -hmysql -uroot -p -P30130 deepflow --hex-blob > /usr/local/deepflow/patch/deepflow.sql
# 重命名原数据目录,防止干扰新数据
mv /var/lib/mysql /var/lib/mysql_$(date +%Y%m%d)_bak
1
2
3
4
2
3
4
#2.2 备份其他数据目录
备份数据前,需先停止 Salt 部署的服务,参考下节《停止 Salt 模式服务》命令
需 OP 根据当前 Salt 部署环境,找到原数据目录,并通过备份迁移,或软连接的方式,挂载到容器化默认路径下
- 源路径查询参考方式:
cat /usr/local/deepflow/saltstack/pillar/disk.sls
容器默认路径参考容器化部署文档 - 依赖 - 数据路径
- pcap:/mnt/pcap
- elasticsearch:/mnt/es
- influxdb-data:/mnt/influxdb/data
- influxdb-meta:/mnt/influxdb/meta
- clickhouse-data: /mnt/clickhouse # 如有多个源文件夹,选择 0-tiers 结尾的
- clickhouse : /var/lib/clickhouse.0/ # 如有多个源文件夹,选择 0-tiers 结尾的,且需修改 templates/values.yaml 中 clickhouse 的 path: /var/lib/clickhouse 为正确目录,示例:path: /var/lib/clickhouse.0
注意: 如 clickhouse 或 elasticsearch Pod 启动报错,可能为数据目录权限不对,参考如下修改目录权限
- clickhouse 目录使用 chown -R 101:101 /var/lib/clickhouse.0/
- clickhouse-data 目录使用 chown -R 101:101 /mnt/clickhouse
- elasticsearch 目录使用 chown -R elasticsearch:elasticsearch /mnt/es
#2.3 停止 Salt 模式服务
systemctl disable --now grafana-server
systemctl disable --now zookeeper
systemctl disable --now cloud-agent
systemctl disable --now df-web-service
systemctl disable --now fauths
systemctl disable --now fpermit
systemctl disable --now fuser
systemctl disable --now talker
systemctl disable --now acl-controller
systemctl disable --now alarm
systemctl disable --now pcap
systemctl disable --now postman
systemctl disable --now report
systemctl disable --now analysis
systemctl disable --now diagnose
systemctl disable --now statistics
systemctl disable --now monitor
systemctl disable --now exchange
systemctl disable --now manager
systemctl disable --now warrant
systemctl disable --now trisolaris
systemctl disable --now genesis
systemctl disable --now droplet
systemctl disable --now pcap-rest
systemctl disable --now apm-server
systemctl disable --now influxdb
systemctl disable --now elasticsearch
systemctl disable --now kibana
systemctl disable --now telegraf
systemctl disable --now chronyd
systemctl disable --now influxdb-relay
systemctl disable --now rsyslog
systemctl disable --now reciter
systemctl disable --now mysqld
systemctl disable --now redis
systemctl disable --now openresty
systemctl disable --now salt-master
systemctl disable --now cleaner
systemctl disable --now cerebro
systemctl disable --now lake
systemctl disable --now httpd
systemctl disable --now webssh.service
systemctl disable --now clickhouse-server@0.service
systemctl disable --now hamgrd.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44