From aba1ad6782df726201680e818189366848711711 Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 11 Jun 2020 14:42:20 +0800 Subject: [PATCH] cherry pick #2766 to release-4.0 Signed-off-by: sre-bot --- TOC.md | 1 + upgrade-tidb-using-tiup-offline.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 upgrade-tidb-using-tiup-offline.md diff --git a/TOC.md b/TOC.md index e386ef62acb81..3a14e7330d66f 100644 --- a/TOC.md +++ b/TOC.md @@ -50,6 +50,7 @@ + Maintain + Upgrade + [Use TiUP (Recommended)](/upgrade-tidb-using-tiup.md) + + [Use TiUP Offline (Recommended)](/upgrade-tidb-using-tiup-offline.md) + [Use TiDB Operator](https://pingcap.com/docs/tidb-in-kubernetes/stable/upgrade-a-tidb-cluster/) + [Use TiDB Ansible](/upgrade-tidb-using-ansible.md) + Scale diff --git a/upgrade-tidb-using-tiup-offline.md b/upgrade-tidb-using-tiup-offline.md new file mode 100644 index 0000000000000..2cfeb909f608a --- /dev/null +++ b/upgrade-tidb-using-tiup-offline.md @@ -0,0 +1,30 @@ +--- +title: Upgrade TiDB Using TiUP Offline Mirror +summary: Learn how to upgrade TiDB using the TiUP offline mirror. +category: how-to +--- + +# Upgrade TiDB Using TiUP Offline Mirror + +This document describes how to upgrade TiDB using TiUP offline mirror. The upgrade steps are as follows. + +## Update TiUP offline mirror + +1. To update the local TiUP offline mirror, refer to Step 1 and Step 2 in [Deploy a TiDB Cluster Offline Using TiUP](/production-offline-deployment-using-tiup.md) to download and deploy the new version of the TiUP offline mirror. + + After you execute `local_install.sh`, TiUP completes the overwrite and upgrade. + +2. Redeclare the global environment variables according to the result of `local_install.sh`. Set `TIUP_MIRRORS` to `/path/to/mirror`, the location of the offline mirror package printed by `local_install.sh`. + + {{< copyable "shell-regular" >}} + + ```bash + source .bash_profile + export TIUP_MIRRORS=/path/to/mirror + ``` + + The offline mirror is successfully updated. After the overwrite, if an error is reported when TiUP is running, it might be that `manifest` is not updated. To fix this, you can execute `rm -rf ~/.tiup/manifests` before using TiUP. + +## Upgrade TiDB cluster + +After the local mirror is updated, refer to [Upgrade TiDB Using TiUP](/upgrade-tidb-using-tiup.md) to upgrade the TiDB cluster.