首页 > 其他分享 >【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤

时间:2023-12-24 18:32:09浏览次数:38  
标签:117.15 v7.5 必看 deploy 升级 cluster tidb 192.11 Serial

作者: 春风十里

TiDB 7.5 已发布了 支持并行运行多个 ADD INDEX 语句 并且兼容MySQL 8.0.  是时候测试一下了,要测试必须先升级。那么下面就是按官方文档指示升级的过程。

升级说明:本次升级测试为测试环境,单机部署。

操作系统版本CentOS Linux release 7.8.2003 (Core)

原tidb版本 6.5.2

**升级版本7.5.0 **

先看看官方的升级介绍:

12 月 1 日,期待已久的 TiDB v7.5.0 LTS 发版。 TiDB 7.5.0 Release Notes

作为 TiDB 7 系列的第二个长期支持版本 (LTS) ,TiDB 7.5 着眼于提升规模化场景下关键应用的稳定性。新版本中,TiDB 在可扩展性与性能、稳定性与高可用、SQL 以及可观测性等方面获得了持续的提升。TiDB 7.5 LTS 包含了已发布的 7.2.0-DMR、7.3.0-DMR 和 7.4.0-DMR 版本中的新功能、提升改进和错误修复,累计优化和修复功能 70 余项。



第一步 升级参考地址

使用 TiUP 升级 TiDB | PingCAP 文档中心



第二步 检查tiup版本



检查tiup版本

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_重启



检查tiup cluster 版本

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_linux_02

确保tiup和tiup cluster 版本不低于 1.11.3



第三步 编辑 TiUP Cluster 拓扑配置文件(可选)

注意,以下情况可跳过此步骤:

  • 原集群没有修改过配置参数,或通过 tiup cluster 修改过参数但不需要调整。
  • 升级后对未修改过的配置项希望使用 7.5.0 默认参数。

如果要保留就的参数配置,或者改变7.5新增的默认的参数,请修改topology 配置文件。



第四步 检查当前集群的健康状况

测试环境有一些操作系统内核参数配置不符合推荐配置。

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_参数配置_03

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_重启_04

可以通过--apply 先尝试自动修复

例如:tiup cluster check mytidb7 --cluster --apply

tiup会尝试自动修复

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_重启_05

如果不能自动修复,需要手工修复,部分操作可能需要重启。

例如:

numactl not usable, bash: numactl: command not found numactl工具可用于查看当前服务器的NUMA节点配置、状态,可通过该工具将进程绑定到指定CPU core,由指定CPU core来运行对应进程。 FIX : yum -y install numactl.x86_64

THP is enabled, please disable it for best performance Transparent Hugepages(THP,页面内存透明化),透明大页面(THP)是一种Linux内存管理系统,通过使用更大的内存页面,可以减少具有大量内存的计算机上的Translation Lookaside Buffer(TLB)查找的开销。但是,数据库工作负载通常在THP上表现不佳,因为它们往往具有稀疏而不是连续的内存访问模式。 您应该在Linux机器上禁用THP以确保使用MongoDB获得最佳性能。争对一些数据库,如Oracle、MariaDB、MongoDB、VoltDB在使用时,要求关闭此功能。 FIX: vim /etc/rc.d/rc.local 1:新增: if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi 2:授权执行: chmod +x /etc/rc.d/rc.local 3:重启: reboot



第五步 检查当前集群的 DDL 和 Backup 情况

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_参数配置_06

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_重启_07

确保无正在执行的ddl语句、无备份任务或者还原任务。



第六步 升级TiDB

tiup cluster upgrade mytidb v7.5.0

因为网络限速,多次升级失败,建议tidb延长默认的下载文件时间

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_重启_08



第七步 升级成功输出

[root@zabbix_server ~]# tiup cluster upgrade mytidb v7.5.0 tiup is checking updates for component cluster ... A new version of cluster is available: The latest version: v1.14.0 Local installed version: v1.12.1 Update current component: tiup update cluster Update all components: tiup update --all

Starting component cluster: /root/.tiup/components/cluster/v1.12.1/tiup-cluster upgrade mytidb v7.5.0 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.5.2 cluster mytidb to v7.5.0. Do you want to continue? [y/N]:(default=N) y Upgrading cluster...

  • [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/mytidb/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/mytidb/ssh/id_rsa.pub
  • [Parallel] - UserSSH: user=tidb, host= 192.11.117.15
  • [Parallel] - UserSSH: user=tidb, host= 192.11.117.15
  • [Parallel] - UserSSH: user=tidb, host= 192.11.117.15
  • [Parallel] - UserSSH: user=tidb, host= 192.11.117.15
  • [Parallel] - UserSSH: user=tidb, host= 192.11.117.15
  • [Parallel] - UserSSH: user=tidb, host= 192.11.117.15
  • [Parallel] - UserSSH: user=tidb, host= 192.11.117.15
  • [Parallel] - UserSSH: user=tidb, host= 192.11.117.15
  • [ Serial ] - Download: component=tikv, version=v7.5.0, os=linux, arch=amd64
  • [ Serial ] - Download: component=prometheus, version=v7.5.0, os=linux, arch=amd64
  • [ Serial ] - Download: component=tiflash, version=v7.5.0, os=linux, arch=amd64
  • [ Serial ] - Download: component=pd, version=v7.5.0, os=linux, arch=amd64
  • [ Serial ] - Download: component=tidb, version=v7.5.0, os=linux, arch=amd64
  • [ Serial ] - Download: component=grafana, version=v7.5.0, os=linux, arch=amd64
  • [ Serial ] - Mkdir: host= 192.11.117.15, directories='/tidb-data/tikv-20162'
  • [ Serial ] - Mkdir: host= 192.11.117.15, directories='/tidb-data/tiflash-9000'
  • [ Serial ] - Mkdir: host= 192.11.117.15, directories='/tidb-data/pd-2379'
  • [ Serial ] - Mkdir: host= 192.11.117.15, directories='/tidb-data/tikv-20161'
  • [ Serial ] - Mkdir: host= 192.11.117.15, directories='/tidb-data/tikv-20160'
  • [ Serial ] - BackupComponent: component=tikv, currentVersion=v6.5.2, remote= 192.11.117.15:/tidb-deploy/tikv-20162
  • [ Serial ] - BackupComponent: component=tiflash, currentVersion=v6.5.2, remote= 192.11.117.15:/tidb-deploy/tiflash-9000
  • [ Serial ] - BackupComponent: component=pd, currentVersion=v6.5.2, remote= 192.11.117.15:/tidb-deploy/pd-2379
  • [ Serial ] - BackupComponent: component=tikv, currentVersion=v6.5.2, remote= 192.11.117.15:/tidb-deploy/tikv-20160
  • [ Serial ] - BackupComponent: component=tikv, currentVersion=v6.5.2, remote= 192.11.117.15:/tidb-deploy/tikv-20161
  • [ Serial ] - CopyComponent: component=tikv, version=v7.5.0, remote= 192.11.117.15:/tidb-deploy/tikv-20162 os=linux, arch=amd64
  • [ Serial ] - CopyComponent: component=pd, version=v7.5.0, remote= 192.11.117.15:/tidb-deploy/pd-2379 os=linux, arch=amd64
  • [ Serial ] - CopyComponent: component=tikv, version=v7.5.0, remote= 192.11.117.15:/tidb-deploy/tikv-20160 os=linux, arch=amd64
  • [ Serial ] - CopyComponent: component=tiflash, version=v7.5.0, remote= 192.11.117.15:/tidb-deploy/tiflash-9000 os=linux, arch=amd64
  • [ Serial ] - CopyComponent: component=tikv, version=v7.5.0, remote= 192.11.117.15:/tidb-deploy/tikv-20161 os=linux, arch=amd64
  • [ Serial ] - InitConfig: cluster=mytidb, user=tidb, host= 192.11.117.15, path=/root/.tiup/storage/cluster/clusters/mytidb/config-cache/tikv-20162.service, deploy_dir=/tidb-deploy/tikv-2016 2, data_dir=[/tidb-data/tikv-20162], log_dir=/tidb-deploy/tikv-20162/log, cache_dir=/root/.tiup/storage/cluster/clusters/mytidb/config-cache+ [ Serial ] - InitConfig: cluster=mytidb, user=tidb, host= 192.11.117.15, path=/root/.tiup/storage/cluster/clusters/mytidb/config-cache/pd-2379.service, deploy_dir=/tidb-deploy/pd-2379, dat a_dir=[/tidb-data/pd-2379], log_dir=/tidb-deploy/pd-2379/log, cache_dir=/root/.tiup/storage/cluster/clusters/mytidb/config-cache+ [ Serial ] - InitConfig: cluster=mytidb, user=tidb, host= 192.11.117.15, path=/root/.tiup/storage/cluster/clusters/mytidb/config-cache/tikv-20160.service, deploy_dir=/tidb-deploy/tikv-2016 0, data_dir=[/tidb-data/tikv-20160], log_dir=/tidb-deploy/tikv-20160/log, cache_dir=/root/.tiup/storage/cluster/clusters/mytidb/config-cache+ [ Serial ] - InitConfig: cluster=mytidb, user=tidb, host= 192.11.117.15, path=/root/.tiup/storage/cluster/clusters/mytidb/config-cache/tiflash-9000.service, deploy_dir=/tidb-deploy/tiflash -9000, data_dir=[/tidb-data/tiflash-9000], log_dir=/tidb-deploy/tiflash-9000/log, cache_dir=/root/.tiup/storage/cluster/clusters/mytidb/config-cache+ [ Serial ] - InitConfig: cluster=mytidb, user=tidb, host= 192.11.117.15, path=/root/.tiup/storage/cluster/clusters/mytidb/config-cache/tikv-20161.service, deploy_dir=/tidb-deploy/tikv-2016 1, data_dir=[/tidb-data/tikv-20161], log_dir=/tidb-deploy/tikv-20161/log, cache_dir=/root/.tiup/storage/cluster/clusters/mytidb/config-cache+ [ Serial ] - Mkdir: host= 192.11.117.15, directories=''
  • [ Serial ] - BackupComponent: component=tidb, currentVersion=v6.5.2, remote= 192.11.117.15:/tidb-deploy/tidb-4000
  • [ Serial ] - Mkdir: host= 192.11.117.15, directories='/tidb-data/prometheus-9090'
  • [ Serial ] - Mkdir: host= 192.11.117.15, directories=''
  • [ Serial ] - BackupComponent: component=grafana, currentVersion=v6.5.2, remote= 192.11.117.15:/tidb-deploy/grafana-3000
  • [ Serial ] - CopyComponent: component=grafana, version=v7.5.0, remote= 192.11.117.15:/tidb-deploy/grafana-3000 os=linux, arch=amd64
  • [ Serial ] - InitConfig: cluster=mytidb, user=tidb, host= 192.11.117.15, path=/root/.tiup/storage/cluster/clusters/mytidb/config-cache/grafana-3000.service, deploy_dir=/tidb-deploy/grafana -3000, data_dir=[], log_dir=/tidb-deploy/grafana-3000/log, cache_dir=/root/.tiup/storage/cluster/clusters/mytidb/config-cache+ [ Serial ] - CopyComponent: component=tidb, version=v7.5.0, remote= 192.11.117.15:/tidb-deploy/tidb-4000 os=linux, arch=amd64
  • [ Serial ] - BackupComponent: component=prometheus, currentVersion=v6.5.2, remote= 192.11.117.15:/tidb-deploy/prometheus-9090
  • [ Serial ] - CopyComponent: component=prometheus, version=v7.5.0, remote= 192.11.117.15:/tidb-deploy/prometheus-9090 os=linux, arch=amd64
  • [ Serial ] - InitConfig: cluster=mytidb, user=tidb, host= 192.11.117.15, path=/root/.tiup/storage/cluster/clusters/mytidb/config-cache/prometheus-9090.service, deploy_dir=/tidb-deploy/prom etheus-9090, data_dir=[/tidb-data/prometheus-9090], log_dir=/tidb-deploy/prometheus-9090/log, cache_dir=/root/.tiup/storage/cluster/clusters/mytidb/config-cache+ [ Serial ] - InitConfig: cluster=mytidb, user=tidb, host= 192.11.117.15, path=/root/.tiup/storage/cluster/clusters/mytidb/config-cache/tidb-4000.service, deploy_dir=/tidb-deploy/tidb-4000, data_dir=[], log_dir=/tidb-deploy/tidb-4000/log, cache_dir=/root/.tiup/storage/cluster/clusters/mytidb/config-cache+ [ Serial ] - UpgradeCluster Upgrading component tiflash Restarting instance 192.11.117.15:9000 Restart instance 192.11.117.15:9000 success Upgrading component pd Restarting instance 192.11.117.15:2379 Restart instance 192.11.117.15:2379 success Upgrading component tikv Restarting instance 192.11.117.15:20160 Restart instance 192.11.117.15:20160 success Evicting 1 leaders from store 192.11.117.15:20161... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Restarting instance 192.11.117.15:20161 Restart instance 192.11.117.15:20161 success Evicting 1 leaders from store 192.11.117.15:20162... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Still waitting for 1 store leaders to transfer... Restarting instance 192.11.117.15:20162 Restart instance 192.11.117.15:20162 success Upgrading component tidb Restarting instance 192.11.117.15:4000 Restart instance 192.11.117.15:4000 success Upgrading component prometheus Restarting instance 192.11.117.15:9090 Restart instance 192.11.117.15:9090 success Upgrading component grafana Restarting instance 192.11.117.15:3000 Restart instance 192.11.117.15:3000 success Stopping component node_exporter Stopping instance 192.11.117.15 Stop 192.11.117.15 success Stopping component blackbox_exporter Stopping instance 192.11.117.15 Stop 192.11.117.15 success Starting component node_exporter Starting instance 192.11.117.15 Start 192.11.117.15 success Starting component blackbox_exporter Starting instance 192.11.117.15 Start 192.11.117.15 success Upgraded cluster mytidb successfully

检查版本

【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤_linux_09



结束语:

虽然是一个简单的升级,实际还是会遇到几个问题,实践大于查看。

这里把整个升级记录一下,以供参考。

标签:117.15,v7.5,必看,deploy,升级,cluster,tidb,192.11,Serial
From: https://blog.51cto.com/tidb/8956433

相关文章

  • TiDB v7.5.0 vs Oceanbase v4.2.1.1: online ddl 吐血验证测试
    作者:h5n11         测试环境3台ARM服务器,同时部署TiDB和OceanBase。TiDB:v7.5.0社区版,kvcache32G,CPU48核(tidb+tikv+pd,numa),普通ssd。Oceanbase:4.2.1.1社区版,租户内存128G,48核,普通ssd。2         测试内容以Oceanbase4.2.1官网文档为基准测试......
  • SpringCloud版本升级个组件替代方案
     转载自:https://juejin.cn/post/7196140566110355515SpringCloud版本升级个组件替代方案 SpringBootSpringBoot版本截止2023年1月20日,SpringBoot的最新版本为 3.0.2,最新的版本信息可以查阅以下网站来获取:Maven中央仓库SpringBoot官方文档SpringB......
  • Spring Boot 3.0 升级 实战踩坑记录
    转载自:https://juejin.cn/post/7176204472082038840SpringBoot3.0升级实战踩坑记录 SpringBoot常用于Java后端开发,于2022年11月24日正式发布了3.0.0版本,带来了全新的特性、升级了依赖版本乃至Java版本,与此同时也弃用或更改了一些旧版本中的写法,导致了需要修改代......
  • Windows下升级go版本过程详解
    安装首次安装需要在官网下载msi安装包,安装完后golang会自动设置环境变量。在命令行可以使用goversion查看版本信息。后续如果需要升级go版本,怎么做?一种通用的办法是在官网下载列表下载对应的msi安装包下载。1https://go.dev/dl/新版本会覆盖旧版本,如果只是想使用指定版......
  • springboot1.x升级到springboot3.x中遇到的问题总结
    springboot1.x升级到springboot3.x中遇到的问题总结springboot1.x升级到springboot3.x中遇到的问题总结前言问题:无法创建DataSource的bean对象,提示url或driverclass未配置问题:引入freemark后页面总是报404问题:bootstrap.yml不生效,配置中的内容无法读取springboot1.x升级到spring......
  • Flutter子工程编译,Ruby升级及Cocoapods安装问题集
    背景:工程为iOS原生与Flutter混合开发的工程,在编译Flutter子工程的过程中报了一个错,一度让我以为是ruby与pod的版本不兼容导致了一些奇奇怪怪的问题,随即来回折腾了Ruby环境升级与pod的升级安装。问题1:flutter子工程执行了flutterpubget,执行flutterbuildios--no-codesign时,报......
  • Tita丨升级看板模式
    看板模式价值:看板模式可以灵活的对任务进行分类和管理,可以根据项目的需要,来创建不同的看板,根据看板,来把任务进行清晰的分类。对于任务和看板可以进行灵活的拖拽,以此来重新设置任务或看板的位置,它比里程碑对任务的展示更加轻量~Tita-OKR和新绩效一体化管理平台该如何来玩转看......
  • 性价比高的CRM系统推荐,选型前必看
     对于中小企业来说,选型CRM系统的重点便是性价比。中小企业预算有限,要在满足需求的前提下选择符合预算的CRM系统。那么,有没有性价比高的CRM系统?ZohoCRM就很不错哦。 ZohoCRM是一款SaaS云端CRM客户管理系统,多次荣获CRM系统国际大奖。不仅如此,ZohoCRM更是连续12年入选Gartne......
  • 我写的蓝宝石留言本php版v7.5
    蓝宝石留言本php版v7.5蓝宝石留言本php版采用原生php,html5,css3,jquery编写,在php5.6.40~php8.x下调试通过。本留言本使用了utf-8编码。include/config1.php是数据库连接参数的配置文件,include/config2是留言板参数的配置文件,include/config1.php可以直接编辑或者在安装时修......
  • 临近年末,整理了一份 Android 程序员必看的面试合集
    前言总体来说,面试一般都是基于你的简历来进行的,一般先考察你的基础,然后考察你知识体系的完备程度,接着会考察你的极限,最后还会考察一些软技能,比如你的学习能力、协作能力、沟通能力、分析解决未知问题的能力、抗压能力等。个人心得凡事预则立,不预则废准备周期面试之前,最好先系统的复......