升级TiDB Cluster-303 在线进行版本升级

不停机升级命令:
tiup cluster upgrade

查看当前集群的版本:
tiup cluster list
[tidb@node201 ~]$ tiup cluster list;
Name User Version Path PrivateKey


tidb-test tidb v6.1.0 /home/tidb/.tiup/storage/cluster/clusters/tidb-test /home/tidb/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa
当前的版本是v6.1.0

查看集群的版本清单:
[tidb@node201 ~]$ tiup list tidb
[tidb@node201 ~]$ tiup list tidb | grep v6.1.*
v6.1.0 2022-06-13T12:30:16+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v6.1.1 2022-09-01T12:09:05+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v6.1.2 2022-10-24T15:16:17+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v6.1.3 2022-12-05T11:50:23+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v6.1.4 2023-02-08T11:34:10+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v6.1.5 2023-02-28T11:23:57+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v6.1.6 2023-04-12T11:05:35+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v6.1.7 2023-07-12T11:22:57+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64

将当前集群版本从v6.1.0升级到v6.1.1
tiup cluster upgrade tidb-test v6.1.1 [–force] [–transfer-timeout=600]

[–force]:表示如果本地的tikv leader没有迁移到其它节点前,可以进行强制升级
[–transfer-timeout=600]:表示等待当前tikv 节点中的leader节点迁移到其它节点的时间,如果tikv leader节点比较多,建议调大这个参数值

注意:TiFlash 5.3版本之前,不支持在线升级,只能停机升级

[tidb@node201 ~]$ tiup cluster upgrade tidb-test v6.1.1
Before the upgrade, it is recommended to read the upgrade guide at https://docs.pingcap.com/tidb/stable/upgrade-tidb-using-tiup and finish the preparation steps.
This operation will upgrade tidb v6.1.0 cluster tidb-test to v6.1.1:
will upgrade and restart component " pd" to “v6.1.1”,
will upgrade and restart component " tikv" to “v6.1.1”,
will upgrade and restart component " tidb" to “v6.1.1”,
will upgrade and restart component " prometheus" to “v6.1.1”,
will upgrade and restart component " grafana" to “v6.1.1”,
will upgrade and restart component " alertmanager" to “”,
will upgrade component “node-exporter” to “”,
will upgrade component “blackbox-exporter” to “”.
Do you want to continue? [y/N]:(default=N) y


Upgrading component tikv
Restarting instance 172.16.1.201:20160
Restart instance 172.16.1.201:20160 success
Evicting 1 leaders from store 172.16.1.202:20160…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Restarting instance 172.16.1.202:20160
Restart instance 172.16.1.202:20160 success
Evicting 1 leaders from store 172.16.1.203:20160…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Still waiting for 1 store leaders to transfer…
Restarting instance 172.16.1.203:20160
Restart instance 172.16.1.203:20160 success

注意tidb leader切换有个超时时间,默认是300秒,

升级完成后,查看版本信息:
、[tidb@node201 ~]$ tiup cluster list
Name User Version Path PrivateKey


tidb-test tidb v6.1.1 /home/tidb/.tiup/storage/cluster/clusters/tidb-test /home/tidb/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa

到此,在线版本升级完成

为啥升级到这个版本 ?

不如升级到6.5.8

303课程吗

实操成功,发个主题。增强了记忆,也获得了积分。 牛~