From bc3ce976cd1284f60a8ba89b8f3434570bb08f46 Mon Sep 17 00:00:00 2001 From: en-jin19 Date: Tue, 10 Aug 2021 21:17:32 +0200 Subject: [PATCH 1/7] TiUP: add instructions for offline mirror --- production-deployment-using-tiup.md | 50 ++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index 771cd4b10b7b2..ffcb0260062a8 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -82,7 +82,9 @@ Perform the following steps in this section to deploy a TiDB cluster offline usi #### Step 1: Prepare the TiUP offline component package -To prepare the TiUP offline component package, manually pack an offline component package using `tiup mirror clone`. +Option 1: Select the corresponding version of the package of the TiDB server's offline mirrors (including the TiUP offline component package) on the [Download TiDB page](https://pingcap.com/download/). + +Option 2: To prepare the TiUP offline component package, manually pack an offline component package using `tiup mirror clone`. 1. Install the TiUP package manager online. @@ -132,6 +134,52 @@ To prepare the TiUP offline component package, manually pack an offline componen `tidb-community-server-${version}-linux-amd64.tar.gz` is an independent offline environment package. +3. Customize the offline mirror, or adjust the contents of the existing offline mirror. + + If the package of the TiDB server's offline mirrors from the PingCAP website does not meet your specific needs, or if you want to make adjustments to the existing offline mirror (like adding a new version of a component), take the following process: + + 1. When pulling an offline mirror, you can get an incomplete offline mirror by specifying specific information, such as components and version. For example, you can pull an offline mirror that includes only the offline mirrors of TiUP v1.5.2 and TiUP Cluster by running the following command: + + {{< copyable "shell-regular" >}} + + ```bash + tiup mirror clone tiup-custom-mirror-v1.5.2 --tiup v1.5.2 --cluster v1.5.2 + ``` + + If you only need the components for a particular platform, you can specify them through `--os` and `--arch`. + + 2. Refer to step 2 mentioned above, "Install TiUP on the control machine", send this incomplete offline mirror to the control machine in the isolated environment. + + 3. Check the path of the current offline mirror on the control machine in the isolated environment. If you installed TiUP in the newer versions, you can get the current mirror address by running the following command: + + {{< copyable "shell-regular" >}} + + ```bash + tiup mirror show + ``` + + If the above command indicates that the `show` command does not exist, you may now use an older version of TiUP. In this case, you can get the current mirror address from `$HOME/.tiup/tiup.toml`. Write down this mirror address, and then use `${base_mirror}` to refer to it. + + 4. Merge an incomplete offline mirror into an existing offline mirror: + + First, copy the `keys` directory in the current offline mirror to the `$HOME/.tiup` directory: + + {{< copyable "shell-regular" >}} + + ```bash + cp -r ${base_mirror}/keys $HOME/.tiup/ + ``` + + Then use the TiUP command to merge the incomplete offline mirror into the currently used mirror: + + {{< copyable "shell-regular" >}} + + ```bash + tiup mirror merge tiup-custom-mirror-v1.5.2 + ``` + + 5. When the above steps are complete, check the results by running the `tiup list'command. In this document's example, you can find the `v1.5.2` version of the corresponding components in the outputs of `tiup list tiup` and `tiup list cluster`. + #### Step 2: Deploy the offline TiUP component After sending the package to the control machine of the target cluster, install the TiUP component by running the following commands: From a42a3916811c6cd58a097e19379dd11ad7c03f4d Mon Sep 17 00:00:00 2001 From: en-jin19 Date: Tue, 10 Aug 2021 21:35:45 +0200 Subject: [PATCH 2/7] fix CI error --- production-deployment-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index ffcb0260062a8..ea28d42fe1fe0 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -178,7 +178,7 @@ Option 2: To prepare the TiUP offline component package, manually pack an offlin tiup mirror merge tiup-custom-mirror-v1.5.2 ``` - 5. When the above steps are complete, check the results by running the `tiup list'command. In this document's example, you can find the `v1.5.2` version of the corresponding components in the outputs of `tiup list tiup` and `tiup list cluster`. + 5. When the above steps are complete, check the results by running the `tiup list`command. In this document's example, you can find the `v1.5.2` version of the corresponding components in the outputs of `tiup list tiup` and `tiup list cluster`. #### Step 2: Deploy the offline TiUP component From e22002a22d8926e659613048ff4090281d26663f Mon Sep 17 00:00:00 2001 From: en-jin19 Date: Wed, 11 Aug 2021 09:29:29 +0200 Subject: [PATCH 3/7] remove a part and revise the corresponding translation --- production-deployment-using-tiup.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index ea28d42fe1fe0..d64e7cdf9dd9f 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -82,9 +82,7 @@ Perform the following steps in this section to deploy a TiDB cluster offline usi #### Step 1: Prepare the TiUP offline component package -Option 1: Select the corresponding version of the package of the TiDB server's offline mirrors (including the TiUP offline component package) on the [Download TiDB page](https://pingcap.com/download/). - -Option 2: To prepare the TiUP offline component package, manually pack an offline component package using `tiup mirror clone`. +To prepare the TiUP offline component package, manually pack an offline component package using `tiup mirror clone`. 1. Install the TiUP package manager online. @@ -136,7 +134,7 @@ Option 2: To prepare the TiUP offline component package, manually pack an offlin 3. Customize the offline mirror, or adjust the contents of the existing offline mirror. - If the package of the TiDB server's offline mirrors from the PingCAP website does not meet your specific needs, or if you want to make adjustments to the existing offline mirror (like adding a new version of a component), take the following process: + If the existing offline mirrors does not meet your specific needs, or if you want to make adjustments to the mirror (like adding a new version of a component), take the following process: 1. When pulling an offline mirror, you can get an incomplete offline mirror by specifying specific information, such as components and version. For example, you can pull an offline mirror that includes only the offline mirrors of TiUP v1.5.2 and TiUP Cluster by running the following command: From a9a6ed4bbe9d9313851d305e61bdf92c4fa23cbe Mon Sep 17 00:00:00 2001 From: Enwei Date: Wed, 11 Aug 2021 10:18:27 +0200 Subject: [PATCH 4/7] Update production-deployment-using-tiup.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- production-deployment-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index d64e7cdf9dd9f..84cbc1a0aa313 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -134,7 +134,7 @@ To prepare the TiUP offline component package, manually pack an offline componen 3. Customize the offline mirror, or adjust the contents of the existing offline mirror. - If the existing offline mirrors does not meet your specific needs, or if you want to make adjustments to the mirror (like adding a new version of a component), take the following process: + If you want to adjust the existing offline mirror (such as adding a new version of a component), take the following steps: 1. When pulling an offline mirror, you can get an incomplete offline mirror by specifying specific information, such as components and version. For example, you can pull an offline mirror that includes only the offline mirrors of TiUP v1.5.2 and TiUP Cluster by running the following command: From 648bc3d200377a5614027301cd252362d7865e95 Mon Sep 17 00:00:00 2001 From: Enwei Date: Wed, 11 Aug 2021 10:32:09 +0200 Subject: [PATCH 5/7] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- production-deployment-using-tiup.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index 84cbc1a0aa313..c0536b615d832 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -136,7 +136,7 @@ To prepare the TiUP offline component package, manually pack an offline componen If you want to adjust the existing offline mirror (such as adding a new version of a component), take the following steps: - 1. When pulling an offline mirror, you can get an incomplete offline mirror by specifying specific information, such as components and version. For example, you can pull an offline mirror that includes only the offline mirrors of TiUP v1.5.2 and TiUP Cluster by running the following command: + 1. When pulling an offline mirror, you can get an incomplete offline mirror by specifying specific information via parameters, such as the component and version information. For example, you can pull an offline mirror that includes only the offline mirror of TiUP v1.5.2 and TiUP Cluster v1.5.2 by running the following command: {{< copyable "shell-regular" >}} @@ -144,11 +144,11 @@ To prepare the TiUP offline component package, manually pack an offline componen tiup mirror clone tiup-custom-mirror-v1.5.2 --tiup v1.5.2 --cluster v1.5.2 ``` - If you only need the components for a particular platform, you can specify them through `--os` and `--arch`. + If you only need the components for a particular platform, you can specify them using the `--os` or `--arch` parameter. - 2. Refer to step 2 mentioned above, "Install TiUP on the control machine", send this incomplete offline mirror to the control machine in the isolated environment. + 2. Refer to the step 2 of "Pull the mirror using TiUP", and send this incomplete offline mirror to the control machine in the isolated environment. - 3. Check the path of the current offline mirror on the control machine in the isolated environment. If you installed TiUP in the newer versions, you can get the current mirror address by running the following command: + 3. Check the path of the current offline mirror on the control machine in the isolated environment. If your TiUP tool is of a newer version, you can get the current mirror address by running the following command: {{< copyable "shell-regular" >}} @@ -156,7 +156,7 @@ To prepare the TiUP offline component package, manually pack an offline componen tiup mirror show ``` - If the above command indicates that the `show` command does not exist, you may now use an older version of TiUP. In this case, you can get the current mirror address from `$HOME/.tiup/tiup.toml`. Write down this mirror address, and then use `${base_mirror}` to refer to it. + If the output of the above command indicates that the `show` command does not exist, you might be using an older version of TiUP. In this case, you can get the current mirror address from `$HOME/.tiup/tiup.toml`. Record this mirror address. In the following steps, `${base_mirror}` is used to refer to this address. 4. Merge an incomplete offline mirror into an existing offline mirror: @@ -168,7 +168,7 @@ To prepare the TiUP offline component package, manually pack an offline componen cp -r ${base_mirror}/keys $HOME/.tiup/ ``` - Then use the TiUP command to merge the incomplete offline mirror into the currently used mirror: + Then use the TiUP command to merge the incomplete offline mirror into the mirror in use: {{< copyable "shell-regular" >}} @@ -176,7 +176,7 @@ To prepare the TiUP offline component package, manually pack an offline componen tiup mirror merge tiup-custom-mirror-v1.5.2 ``` - 5. When the above steps are complete, check the results by running the `tiup list`command. In this document's example, you can find the `v1.5.2` version of the corresponding components in the outputs of `tiup list tiup` and `tiup list cluster`. + 5. When the above steps are completed, check the result by running the `tiup list` command. In this document's example, the outputs of both `tiup list tiup` and `tiup list cluster` show that the version of the corresponding component is `v1.5.2`. #### Step 2: Deploy the offline TiUP component From 753311a2dea290f15da48f1fde92d45564db7d67 Mon Sep 17 00:00:00 2001 From: Enwei Date: Wed, 18 Aug 2021 11:46:42 +0200 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Allen Zhong --- production-deployment-using-tiup.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index c0536b615d832..e9235b3858ae8 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -132,9 +132,9 @@ To prepare the TiUP offline component package, manually pack an offline componen `tidb-community-server-${version}-linux-amd64.tar.gz` is an independent offline environment package. -3. Customize the offline mirror, or adjust the contents of the existing offline mirror. +3. Customize the offline mirror, or adjust the contents of an existing offline mirror. - If you want to adjust the existing offline mirror (such as adding a new version of a component), take the following steps: + If you want to adjust an existing offline mirror (such as adding a new version of a component), take the following steps: 1. When pulling an offline mirror, you can get an incomplete offline mirror by specifying specific information via parameters, such as the component and version information. For example, you can pull an offline mirror that includes only the offline mirror of TiUP v1.5.2 and TiUP Cluster v1.5.2 by running the following command: @@ -144,11 +144,11 @@ To prepare the TiUP offline component package, manually pack an offline componen tiup mirror clone tiup-custom-mirror-v1.5.2 --tiup v1.5.2 --cluster v1.5.2 ``` - If you only need the components for a particular platform, you can specify them using the `--os` or `--arch` parameter. + If you only need the components for a particular platform, you can specify them using the `--os` or `--arch` parameters. 2. Refer to the step 2 of "Pull the mirror using TiUP", and send this incomplete offline mirror to the control machine in the isolated environment. - 3. Check the path of the current offline mirror on the control machine in the isolated environment. If your TiUP tool is of a newer version, you can get the current mirror address by running the following command: + 3. Check the path of the current offline mirror on the control machine in the isolated environment. If your TiUP tool is of a recent version, you can get the current mirror address by running the following command: {{< copyable "shell-regular" >}} From 33d3f54de7c73de456f3247acbb63f3ba5d3b3d0 Mon Sep 17 00:00:00 2001 From: Enwei Date: Mon, 23 Aug 2021 18:27:46 +0200 Subject: [PATCH 7/7] Apply suggestions from code review Co-authored-by: Allen Zhong --- production-deployment-using-tiup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index e9235b3858ae8..e2fb00a95e3b4 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -176,7 +176,7 @@ To prepare the TiUP offline component package, manually pack an offline componen tiup mirror merge tiup-custom-mirror-v1.5.2 ``` - 5. When the above steps are completed, check the result by running the `tiup list` command. In this document's example, the outputs of both `tiup list tiup` and `tiup list cluster` show that the version of the corresponding component is `v1.5.2`. + 5. When the above steps are completed, check the result by running the `tiup list` command. In this document's example, the outputs of both `tiup list tiup` and `tiup list cluster` show that the corresponding components of `v1.5.2` are available. #### Step 2: Deploy the offline TiUP component