tidb4.0.4升级到tidb4.0.12
实际操作:
1、下载4.0.12离线包
2、升级tiup
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | cd /data1/update_tidb tar xzvf tidb-community-server-v4.0.12-linux-amd64. tar .gz [root@host-172-21-210-40 update_tidb] # tiup -version v1.0.8 tiup Go Version: go1.13 Git Branch: master GitHash: 4276089 sh tidb-community-server-v4.0.12-linux-amd64 /local_install .sh source /home/tidb/ .bash_profile [tidb@host-172-21-210-40 update_tidb]$ tiup -version 1.4.0 tiup Go Version: go1.16.2 Git Ref: v1.4.0 GitHash: eb335e6ad9d0dc19d1c43db422cd409d62bc3cea |
3、升级cluster
1 2 3 4 5 6 7 8 9 | [root@host-172-21-210-40 ~] # tiup cluster --version Starting component `cluster`: --version tiup version v1.0.8 tiup Go Version: go1.13 Git Branch: master GitHash: 4276089 [root@host-172-21-210-40 update_tidb] # tiup update cluster component cluster version v1.4.0 is already installed Updated successfully! |
4、升级集群(根据数据多少来定时间,数据越多时间越长)
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | [root@host-172-21-210-40 update_tidb] # tiup cluster upgrade tidb v4.0.12 Starting component `cluster`: /root/ .tiup /components/cluster/v1 .4.0 /tiup-cluster upgrade tidb v4.0.12 This operation will upgrade tidb v4.0.4 cluster tidb to v4.0.12. Do you want to continue ? [y /N ]:(default=N) Upgrading cluster... + [ Serial ] - SSHKeySet: privateKey= /root/ .tiup /storage/cluster/clusters/tidb/ssh/id_rsa , publicKey= /root/ .tiup /storage/cluster/clusters/tidb/ssh/id_rsa .pub + [Parallel] - UserSSH: user=tidb, host=172.21.210.40 + [Parallel] - UserSSH: user=tidb, host=172.21.210.40 + [Parallel] - UserSSH: user=tidb, host=172.21.210.44 + [Parallel] - UserSSH: user=tidb, host=172.21.210.40 + [Parallel] - UserSSH: user=tidb, host=172.21.210.40 + [Parallel] - UserSSH: user=tidb, host=172.21.210.43 + [Parallel] - UserSSH: user=tidb, host=172.21.210.45 + [Parallel] - UserSSH: user=tidb, host=172.21.210.46 + [Parallel] - UserSSH: user=tidb, host=172.21.210.40 + [ Serial ] - Download: component=alertmanager, version=, os=linux, arch=amd64 + [ Serial ] - Download: component=tikv, version=v4.0.12, os=linux, arch=amd64 + [ Serial ] - Download: component=prometheus, version=v4.0.12, os=linux, arch=amd64 + [ Serial ] - Download: component=tidb, version=v4.0.12, os=linux, arch=amd64 + [ Serial ] - Download: component=grafana, version=v4.0.12, os=linux, arch=amd64 + [ Serial ] - Download: component=tiflash, version=v4.0.12, os=linux, arch=amd64 + [ Serial ] - Download: component=pd, version=v4.0.12, os=linux, arch=amd64 + [ Serial ] - BackupComponent: component=pd, currentVersion=v4.0.4, remote=172.21.210.40: /data1/tidb-deploy/pd-2379 + [ Serial ] - BackupComponent: component=tidb, currentVersion=v4.0.4, remote=172.21.210.40: /data1/tidb-deploy/tidb-4000 + [ Serial ] - BackupComponent: component=alertmanager, currentVersion=v4.0.4, remote=172.21.210.40: /data1/tidb-deploy/alertmanager-9093 + [ Serial ] - BackupComponent: component=tiflash, currentVersion=v4.0.4, remote=172.21.210.46: /data1/tidb-deploy/tiflash-9000 + [ Serial ] - BackupComponent: component=tikv, currentVersion=v4.0.4, remote=172.21.210.45: /data1/tidb-deploy/tikv-20160 + [ Serial ] - BackupComponent: component=tikv, currentVersion=v4.0.4, remote=172.21.210.43: /data1/tidb-deploy/tikv-20160 + [ Serial ] - BackupComponent: component=prometheus, currentVersion=v4.0.4, remote=172.21.210.40: /data1/tidb-deploy/prometheus-9090 + [ Serial ] - BackupComponent: component=grafana, currentVersion=v4.0.4, remote=172.21.210.40: /data1/tidb-deploy/grafana-3000 + [ Serial ] - BackupComponent: component=tikv, currentVersion=v4.0.4, remote=172.21.210.44: /data1/tidb-deploy/tikv-20160 + [ Serial ] - CopyComponent: component=pd, version=v4.0.12, remote=172.21.210.40: /data1/tidb-deploy/pd-2379 os=linux, arch=amd64 + [ Serial ] - CopyComponent: component=tidb, version=v4.0.12, remote=172.21.210.40: /data1/tidb-deploy/tidb-4000 os=linux, arch=amd64 + [ Serial ] - CopyComponent: component=alertmanager, version=, remote=172.21.210.40: /data1/tidb-deploy/alertmanager-9093 os=linux, arch=amd64 + [ Serial ] - CopyComponent: component=prometheus, version=v4.0.12, remote=172.21.210.40: /data1/tidb-deploy/prometheus-9090 os=linux, arch=amd64 + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.40, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/alertmanager-9093 .service, deploy_dir= /data1/tidb-deploy/alertmanager-9093 , data_dir=[ /data1/tidb-data/alertmanager-9093 ], log_dir= /data1/tidb-deploy/alertmanager-9093/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.40, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/pd-2379 .service, deploy_dir= /data1/tidb-deploy/pd-2379 , data_dir=[ /data1/tidb-data/pd-2379 ], log_dir= /data1/tidb-deploy/pd-2379/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - CopyComponent: component=tikv, version=v4.0.12, remote=172.21.210.44: /data1/tidb-deploy/tikv-20160 os=linux, arch=amd64 + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.40, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/tidb-4000 .service, deploy_dir= /data1/tidb-deploy/tidb-4000 , data_dir=[], log_dir= /data1/tidb-deploy/tidb-4000/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - CopyComponent: component=tikv, version=v4.0.12, remote=172.21.210.43: /data1/tidb-deploy/tikv-20160 os=linux, arch=amd64 + [ Serial ] - CopyComponent: component=tikv, version=v4.0.12, remote=172.21.210.45: /data1/tidb-deploy/tikv-20160 os=linux, arch=amd64 + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.40, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/prometheus-9090 .service, deploy_dir= /data1/tidb-deploy/prometheus-9090 , data_dir=[ /data1/tidb-data/prometheus-9090 ], log_dir= /data1/tidb-deploy/prometheus-9090/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.44, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/tikv-20160 .service, deploy_dir= /data1/tidb-deploy/tikv-20160 , data_dir=[ /data1/tidb-data/tikv-20160 ], log_dir= /data1/tidb-deploy/tikv-20160/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - CopyComponent: component=tiflash, version=v4.0.12, remote=172.21.210.46: /data1/tidb-deploy/tiflash-9000 os=linux, arch=amd64 + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.43, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/tikv-20160 .service, deploy_dir= /data1/tidb-deploy/tikv-20160 , data_dir=[ /data1/tidb-data/tikv-20160 ], log_dir= /data1/tidb-deploy/tikv-20160/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.45, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/tikv-20160 .service, deploy_dir= /data1/tidb-deploy/tikv-20160 , data_dir=[ /data1/tidb-data/tikv-20160 ], log_dir= /data1/tidb-deploy/tikv-20160/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - CopyComponent: component=grafana, version=v4.0.12, remote=172.21.210.40: /data1/tidb-deploy/grafana-3000 os=linux, arch=amd64 + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.40, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/grafana-3000 .service, deploy_dir= /data1/tidb-deploy/grafana-3000 , data_dir=[], log_dir= /data1/tidb-deploy/grafana-3000/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - InitConfig: cluster=tidb, user=tidb, host=172.21.210.46, path= /root/ .tiup /storage/cluster/clusters/tidb/config-cache/tiflash-9000 .service, deploy_dir= /data1/tidb-deploy/tiflash-9000 , data_dir=[ /data1/tidb-data/tiflash-9000 ], log_dir= /data1/tidb-deploy/tiflash-9000/log , cache_dir= /root/ .tiup /storage/cluster/clusters/tidb/config-cache + [ Serial ] - UpgradeCluster Upgrading component tiflash Restarting instance 172.21.210.46 Restart 172.21.210.46 success Upgrading component pd Restarting instance 172.21.210.40 Restart 172.21.210.40 success Upgrading component tikv Evicting 2233 leaders from store 172.21.210.43:20160... Still waitting for 2233 store leaders to transfer... Still waitting for 2233 store leaders to transfer... Still waitting for 2233 store leaders to transfer... Still waitting for 2233 store leaders to transfer... Still waitting for 2232 store leaders to transfer... Still waitting for 2232 store leaders to transfer... Restarting instance 172.21.210.43 Restart 172.21.210.43 success Evicting 3350 leaders from store 172.21.210.44:20160... Still waitting for 3350 store leaders to transfer... Still waitting for 3350 store leaders to transfer... Still waitting for 3284 store leaders to transfer... Still waitting for 3284 store leaders to transfer... Still waitting for 3284 store leaders to transfer... Still waitting for 3284 store leaders to transfer... Still waitting for 145 store leaders to transfer... Still waitting for 145 store leaders to transfer... Restarting instance 172.21.210.44 Restart 172.21.210.44 success Evicting 3360 leaders from store 172.21.210.45:20160... Still waitting for 3360 store leaders to transfer... Still waitting for 3360 store leaders to transfer... Still waitting for 3360 store leaders to transfer... Still waitting for 3360 store leaders to transfer... Still waitting for 3215 store leaders to transfer... Still waitting for 3215 store leaders to transfer... Still waitting for 3215 store leaders to transfer... Still waitting for 79 store leaders to transfer... Still waitting for 79 store leaders to transfer... Still waitting for 79 store leaders to transfer... Still waitting for 79 store leaders to transfer... Restarting instance 172.21.210.45 Restart 172.21.210.45 success Upgrading component tidb Restarting instance 172.21.210.40 Restart 172.21.210.40 success Upgrading component prometheus Restarting instance 172.21.210.40 Restart 172.21.210.40 success Upgrading component grafana Restarting instance 172.21.210.40 Restart 172.21.210.40 success Upgrading component alertmanager Restarting instance 172.21.210.40 Restart 172.21.210.40 success Upgraded cluster `tidb` successfully |
做一个决定,并不难,难的是付诸行动,并且坚持到底。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)