TiDB 2.1.5 升级记录

由于验证bug的问题或者生产环境的演练,升级到TiDB的最新版本,仅做记录。
TiDB 于2019年2月28日发布,之前PoC测试使用的为TiDB2.1.3版本。

-- 升级前的版本:
MySQL [(none)]> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.3
Git Commit Hash: d842dc373a4bf9e19c1a756e1409a3ad60787d01
Git Branch: release-2.1
UTC Build Time: 2019-01-28 06:38:45
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)

--各个组件的版本查询:
# ./tidb-server  -V
Release Version: v2.1.3
Git Commit Hash: d842dc373a4bf9e19c1a756e1409a3ad60787d01
Git Branch: release-2.1
UTC Build Time: 2019-01-28 06:38:45
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false

# ./tikv-server -V
TiKV 
Release Version:   2.1.3
Git Commit Hash:   f8c478ad646d045fb99cdf06274a7ad229e8b822
Git Commit Branch: release-2.1
UTC Build Time:    2019-01-28 06:38:24
Rust Version:      rustc 1.29.0-nightly (4f3c7a472 2018-07-17)
# ./pd-server -V
Release Version: v2.1.3
Git Commit Hash: e4124210b3cb423997e71c19f1830567f39329aa
Git Branch: release-2.1
UTC Build Time:  2019-01-28 06:47:26
# ./tidb-lightning -V
Release Version: v2.1.2-17-g870be6f
Git Commit Hash: 870be6fb9f8e276b0d5973006aca278d379b632a
Git Branch: release-2.1
UTC Build Time: 2019-01-28 05:27:55
Go Version: go version go1.11.2 linux/amd64

# ./pump -V
2019/03/01 14:53:04 version.go:18: [info] Git Commit Hash: 50f5b19d55371b28840f56b778db48420cff761a
2019/03/01 14:53:04 version.go:19: [info] Build TS: 2019-01-26 11:47:07
2019/03/01 14:53:04 version.go:20: [info] Go Version: go1.11.2
2019/03/01 14:53:04 version.go:21: [info] Go OS/Arch: linuxamd64

-- 准备工作:
ansible>=2.4.2,<2.7.0)
另依赖 Python 模块:jinja2>=2.9.6 和 jmespath>=0.9.0
否则需要自己安装ansible及其依赖的软件:
 $ cd /home/tidb/tidb-ansible
  $ sudo pip install -r ./requirements.txt
--依赖的版本确认:
# pip list | grep -E -i 'jmespath|jinja2|ansible'
ansible (2.6.3)
Jinja2 (2.10)
jmespath (0.9.3)
-- 升级步骤:
1.修改版本:
$ vim /home/tidb/tidb-ansible/inventory.ini
原来的值为2.1.3
tidb_version = v2.1.5
2.备份或删除原有的组件:
$ cd /home/tidb/tidb-ansible/
$ mv downloads/ downloads2.1.3
 
3.重新下载组件:
$ ansible-playbook local_prepare.yml

4.滚动升级所有服务(依次升级 PD,TiKV,TiDB 服务,如果 TiDB 集群开启了 binlog,升级 TiDB 服务时会升级 pump):
$ ansible-playbook rolling_update.yml

5.启动服务:(可选 ,视情况而定)
$ $ ansible-playbook start.yml

5.版本验证:

mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.5-1-g0bd6b1b
Git Commit Hash: 0bd6b1b60816bf8a2022e657d7a472311548d82e
Git Branch: release-2.1
UTC Build Time: 2019-02-28 08:17:03
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)

--TiDB:
# ./tidb-server -V
Release Version: v2.1.5-1-g0bd6b1b
Git Commit Hash: 0bd6b1b60816bf8a2022e657d7a472311548d82e
Git Branch: release-2.1
UTC Build Time: 2019-02-28 08:17:03
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
--TiKV:
# ./tikv-server -V     
TiKV 
Release Version:   2.1.5
Git Commit Hash:   24c94b45b9a24e35b34afe62be1a798ae298e005
Git Commit Branch: release-2.1
UTC Build Time:    2019-02-28 08:20:08
Rust Version:      rustc 1.29.0-nightly (4f3c7a472 2018-07-17)
--PD:
# ./pd-server -V     
Release Version: v2.1.3-2-g78515a1
Git Commit Hash: 78515a1a200a3b97a483cabb6196158d653e0aff
Git Branch: release-2.1
UTC Build Time:  2019-02-28 11:19:17
--TiDB-lightning:
# ./tidb-lightning -V
Release Version: v2.1.2-17-g870be6f
Git Commit Hash: 870be6fb9f8e276b0d5973006aca278d379b632a
Git Branch: release-2.1
UTC Build Time: 2019-01-28 05:27:55
Go Version: go version go1.11.2 linux/amd64

# ./pump -V
2019/03/01 15:40:33 version.go:18: [info] Git Commit Hash: 6b3db13924928e2ab148fbff268fed7be22e789e
2019/03/01 15:40:33 version.go:19: [info] Build TS: 2019-02-28 08:24:34
2019/03/01 15:40:33 version.go:20: [info] Go Version: go1.11.2
2019/03/01 15:40:33 version.go:21: [info] Go OS/Arch: linuxamd64

 

你可能感兴趣的:(TiDB)