Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiUP: add instructions for offline mirror #6137

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion production-deployment-using-tiup.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,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/).
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

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.

Expand Down Expand Up @@ -133,6 +135,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.
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

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:
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

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:
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

{{< 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`.
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

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.
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

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:
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

{{< 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.
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

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:
en-jin19 marked this conversation as resolved.
Show resolved Hide resolved

{{< 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:
Expand Down