You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TiDB can be deployed on-premise or in-cloud. The following deployment options are officially supported by PingCAP:
13
13
14
-
-[TiUP Deployment](/production-deployment-using-tiup.md): This guide describes how to deploy TiDB using [TiUP](https://github.com/pingcap-incubator/tiup). It is strongly recommended for production deployment.
14
+
-[TiUP Deployment](/production-deployment-using-tiup.md): This guide describes how to deploy TiDB using [TiUP](https://github.com/pingcap/tiup). It is strongly recommended for production deployment.
15
15
-[Docker Deployment](/test-deployment-using-docker.md): This guide describes how to deploy TiDB using Docker.
16
16
-[Docker Compose Deployment](/deploy-test-cluster-using-docker-compose.md): This guide describes how to deploy TiDB using Docker compose. You can follow this guide to quickly deploy a TiDB cluster for testing and development on your local drive.
This command requires you to provide the cluster name, the TiDB cluster version, and a topology file of the cluster.
65
65
66
-
To write a topology file, refer to [the example](https://github.com/pingcap-incubator/tiup-cluster/blob/master/examples/topology.example.yaml). The following file is an example of the simplest topology:
66
+
To write a topology file, refer to [the example](https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml). The following file is an example of the simplest topology:
When creating a private cloud, usually, you need to use an isolated network environment, where the official mirror of TiUP is not accessible. Therefore, you can create a private mirror, which is mainly implemented by the `mirrors` component. You can also use `mirrors` for offline deployment.
10
+
When creating a private cloud, usually, you need to use an isolated network environment, where the official mirror of TiUP is not accessible. Therefore, you can create a private mirror, which is mainly implemented by the `mirror` command. You can also use the `mirror` command for offline deployment.
11
11
12
-
## TiUP `mirrors` overview
12
+
## TiUP `mirror` overview
13
13
14
-
Execute the following command to get the help information of the `mirrors` component:
14
+
Execute the following command to get the help information of the `mirror` command:
-`target-dir`: used to specify the directory in which cloned data is stored.
70
53
-`global-version`: used to quickly set a global version for all components.
71
54
72
-
The `tiup mirrors` command provides many optional flags (might provide more in the future). These flags can be divided into the following categories according to their intended usages:
55
+
The `tiup mirror clone` command provides many optional flags (might provide more in the future). These flags can be divided into the following categories according to their intended usages:
73
56
74
-
- Determines whether to overwrite local packages
57
+
- Determines whether to use prefix matching to match the version when cloning
75
58
76
-
The `--overwrite` flag determines whether to overwrite the local package with the package of the official mirror, if the specified `<target-dir>` directory contains the package you need to download. If you set this flag, the local package is overwritten.
59
+
If the `--prefix` flag is specified, the version number is matched by prefix for the clone. For example, if you specify `--prefix` as "v4.0.0", then "v4.0.0-rc.1", "v4.0.0-rc.2", and "v4.0.0" are matched.
77
60
78
61
- Determines whether to use the full clone
79
62
80
63
If you specify the `--full` flag, you can clone the official mirror fully.
81
64
82
65
> **Note:**
83
66
>
84
-
> If `--full`and the other flags are not specified, only some meta information is cloned.
67
+
> If `--full`, `global-version` flags, and the component versions are not specified, only some meta information is cloned.
85
68
86
69
- Determines whether to clone packages from the specific platform
87
70
88
71
If you want to clone packages only for a specific platform, use `-os` and `-arch` to specify the platform. For example:
89
72
90
-
- Execute the `tiup mirros <target-dir> --os=linux` command to clone for linux.
91
-
- Execute the `tiup mirros <target-dir> --arch=amd64` command to clone for amd64.
92
-
- Execute the `tiup mirros <target-dir> --os=linux --arch=amd64` command to clone for linux/amd64.
73
+
- Execute the `tiup mirror clone <target-dir> [global-version] --os=linux` command to clone for linux.
74
+
- Execute the `tiup mirror clone <target-dir> [global-version] --arch=amd64` command to clone for amd64.
75
+
- Execute the `tiup mirror clone <target-dir> [global-version] --os=linux --arch=amd64` command to clone for linux/amd64.
93
76
94
77
- Determines whether to clone a specific version of a package
95
78
96
79
If you want to clone only one version (not all versions) of a component, use `--<component>=<version>` to specify this version. For example:
97
80
98
-
- Execute the `tiup mirrors <target-dir> --tidb v4` command to clone the v4 version of the TiDB component.
99
-
- Execute the `tiup mirros <target-dir> --tidb v4 --tikv all` command to clone the v4 version of the TiDB component and all versions of the TiKV component.
100
-
- Execute the `tiup mirrors <target-dir> v4.0.0-rc` command to clone the v4.0.0-rc version of all components in a cluster.
81
+
- Execute the `tiup mirror clone <target-dir> --tidb v4.0.0` command to clone the v4.0.0 version of the TiDB component.
82
+
- Execute the `tiup mirror clone <target-dir> --tidb v4.0.0 --tikv all` command to clone the v4.0.0 version of the TiDB component and all versions of the TiKV component.
83
+
- Execute the `tiup mirror clone <target-dir> v4.0.0` command to clone the v4.0.0 version of all components in a cluster.
101
84
102
85
## Usage examples
103
86
104
-
This section introduces the usage examples of `mirrors`, including offline installation of a TiDB cluster, and the creation of a private mirror.
105
-
106
-
### Install a TiDB cluster offline using TiUP
107
-
108
-
If you want to install a TiDB cluster of the v4.0.0-rc version in an isolated environment, take the following steps:
109
-
110
-
1. Pull the required components on a machine connected to the external network:
111
-
112
-
{{< copyable "shell-regular" >}}
113
-
114
-
```bash
115
-
tiup mirrors package --os=linux v4.0.0-rc
116
-
```
117
-
118
-
Then a `package` directory is created in the current directory. This `package` directory contains necessary components packages to start a cluster.
119
-
120
-
2. Use the `tar`command to pack the components package and send this package to the control machine that is in the isolated environment:
121
-
122
-
{{< copyable "shell-regular">}}
123
-
124
-
```bash
125
-
tar czvf package.tar.gz package
126
-
```
127
-
128
-
Then `package.tar.gz` is an isolated, offline environment.
129
-
130
-
3. After sending the package to the control machine of the target cluster, execute the following command to install TiUP:
131
-
132
-
{{< copyable "shell-regular">}}
133
-
134
-
```bash
135
-
tar xzvf package.tar.gz
136
-
cd package
137
-
sh local_install.sh
138
-
```
139
-
140
-
4. Follow the instructions to finish the installation of TiUP, and then deploy the TiDB cluster:
This section introduces the usage examples of the `mirror` command.
149
88
150
-
`/path/to/mirror` refers to where `<target-dir>` (in `tiup mirrors <target-dir>`) is. If `/tmp/package` refers to where `<target-dir>` is, execute the following command instead:
151
-
152
-
{{< copyable "shell-regular">}}
153
-
154
-
```bash
155
-
export TIUP_MIRRORS=/tmp/package
156
-
```
157
-
158
-
After you complete the deployment, refer to [Deploy and Maintain an Online TiDB Cluster Using TiUP](/tiup/tiup-cluster.md) for more details of the cluster operations.
159
-
160
-
### Create a private mirror
161
-
162
-
The process of creating a private mirror is similar to that of creating an offline installer. The only difference is that, to create a private mirror, you need to upload the content of the `package` directory to CDN or a file server. Execute the following command to create a private mirror:
163
-
164
-
{{< copyable "shell-regular">}}
165
-
166
-
```bash
167
-
cd package
168
-
python -m SimpleHTTPServer 8000
169
-
```
170
-
171
-
Now you have created a private mirror at <http://127.0.0.1:8000>.
172
-
173
-
Then execute the following command to install TiUP using the private mirror:
174
-
175
-
{{< copyable "shell-regular">}}
176
-
177
-
```bash
178
-
export TIUP_MIRRORS=http://127.0.0.1:8000
179
-
curl $TIUP_MIRRORS/install.sh | sh
180
-
```
89
+
### Deploy a TiDB Cluster Offline Using TiUP
181
90
182
-
After importing the `PATH` variable, you can start to use TiUP. Make sure that the `TIUP_MIRRORS` variable points to the private mirror.
91
+
Refer to [Deploy a TiDB Cluster Offline Using TiUP](/production-offline-deployment-using-tiup.md#manually-pack-an-offline-component-package-using-tiup-mirror-clone) to install the TiUP offline mirror, deploy a TiDB cluster, and start it.
0 commit comments