upgrade of your TiDB cluster from version 7.5.1 to 8.1 using TiUP.
To upgrade your TiDB cluster from version 7.5.1 to 8.1 using TiUP, you need to follow a series of pre-upgrade preparations and post-upgrade tasks to ensure a smooth and successful upgrade process. Here are the detailed steps and considerations:
Pre-Upgrade Preparation
-
Check TiUP and TiUP Cluster Versions:
Ensure that both TiUP and TiUP Cluster versions are up-to-date and not lower than 1.11.3.tiup update --self tiup update cluster
-
Backup Current Cluster:
Always back up your current cluster before performing an upgrade to prevent data loss in case of any issues.ADMIN SHOW DDL; SHOW BACKUPS; SHOW RESTORES;
-
Check Cluster Health:
Verify the health of your current cluster to ensure there are no ongoing issues.tiup cluster check <cluster-name> --cluster
-
Edit Configuration (Optional):
If you need to retain old configuration parameters or adjust new ones introduced in version 8.1, edit the TiUP Cluster topology configuration file.tiup cluster edit-config <cluster-name>
-
Check DDL and Backup Tasks:
Ensure there are no ongoing DDL operations or backup/restore tasks.ADMIN SHOW DDL; ADMIN CANCEL DDL; SHOW BACKUPS; SHOW RESTORES;
-
Fix System Configuration Issues:
Address any system configuration issues that might affect the upgrade process.tiup cluster check <cluster-name> --cluster --apply
Upgrade Process
-
Perform the Upgrade:
Use the TiUP command to upgrade the cluster to the specified version.tiup cluster upgrade <cluster-name> 8.1.0
-
Monitor the Upgrade Progress:
Keep an eye on the upgrade logs to ensure that the process completes successfully without any interruptions.
Post-Upgrade Tasks
-
Verify Cluster Status:
After the upgrade, check the status of the cluster to ensure all components are running correctly.tiup cluster display <cluster-name>
-
Check for Errors:
Review the logs and audit records to identify any errors or issues that occurred during the upgrade.tiup cluster audit
-
Update Tools and Components:
Ensure that all related tools and components, such aspd-ctl
, are updated to the latest versions.tiup install ctl:8.1.0
-
Perform Health Checks:
Conduct a thorough health check of the cluster to confirm that it is functioning as expected.tiup cluster check <cluster-name> --cluster
-
Test Cluster Functionality:
Run tests to verify that the cluster’s functionality and performance meet your requirements.
Best Practices
-
Read the Upgrade Guide:
Before starting the upgrade, read the official upgrade guide for any specific instructions or considerations.
Upgrade TiDB Using TiUP -
Perform Upgrades During Maintenance Windows:
Schedule the upgrade during a maintenance window to minimize the impact on your production environment. -
Prepare for Rollback:
Have a rollback plan in place in case the upgrade does not go as planned.
By following these steps and best practices, you can ensure a smooth and successful upgrade of your TiDB cluster from version 7.5.1 to 8.1 using TiUP.
: 专栏 - 【新手升级必看】从 TiDB v6.5升级到 v7.5 的实践步骤 | TiDB 社区
: 专栏 - TiDB v7.1.0离线升级命令版 | TiDB 社区
I don’t think we have some ways to switch back if you are using TiUP to upgrade the TiDB cluster. However, you can use this way to upgrade and have a way to change back like:
- Create a new cluster with 8.1 version
- Use BR to resume the data in the new cluster
- Establish a TiCDC from 7.5.1 cluster to 8.1 version cluster
- Shift to the new cluster, and if you encounter any error, you can change back to the old cluster.