Skip to content

Commit bebb1ed

Browse files
author
yikeke
committed
1 parent 35cc2fa commit bebb1ed

File tree

5 files changed

+45
-141
lines changed

5 files changed

+45
-141
lines changed

overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ aliases: ['/docs/dev/overview/']
1111

1212
TiDB can be deployed on-premise or in-cloud. The following deployment options are officially supported by PingCAP:
1313

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.
1515
- [Docker Deployment](/test-deployment-using-docker.md): This guide describes how to deploy TiDB using Docker.
1616
- [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.
1717
- Kubernetes Deployment:

production-offline-deployment-using-tiup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can either download the official package, or manually pack a component packa
1515

1616
### Download the official TiUP offline component package
1717

18-
Download the prepared offline mirror package at <http://download.pingcap.org> by running the following command:
18+
Download the prepared offline mirror package at `http://download.pingcap.org` by running the following command:
1919

2020
{{< copyable "shell-regular" >}}
2121

tiup/tiup-cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ tiup cluster deploy <cluster-name> <version> <topology.yaml> [flags]
6363

6464
This command requires you to provide the cluster name, the TiDB cluster version, and a topology file of the cluster.
6565

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:
6767

6868
> **Note:**
6969
>

tiup/tiup-mirror.md

Lines changed: 37 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -7,176 +7,85 @@ aliases: ['/docs/dev/tiup/tiup-mirrors/','/docs/dev/reference/tools/tiup/mirrors
77

88
# Create a Private Mirror
99

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 `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.
1111

12-
## TiUP `mirrors` overview
12+
## TiUP `mirror` overview
1313

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:
1515

1616
{{< copyable "shell-regular" >}}
1717

1818
```bash
19-
tiup mirrors --help
19+
tiup mirror --help
2020
```
2121

22-
```
23-
Starting component `mirrors`: /Users/joshua/.tiup/components/mirrors/v0.0.1/mirrors
24-
Build a local mirrors and download all selected components
22+
```bash
23+
The 'mirror' command is used to manage a component repository for TiUP, you can use
24+
it to create a private repository, or to add new component to an existing repository.
25+
The repository can be used either online or offline.
26+
It also provides some useful utilities to help managing keys, users and versions
27+
of components or the repository itself.
2528
Usage:
26-
tiup mirrors <target-dir> [global-version] [flags]
27-
Examples:
28-
tiup mirrors local-path --arch amd64,arm --os linux,darwin # Specify the architectures and OSs
29-
tiup mirrors local-path --full # Build a full local mirrors
30-
tiup mirrors local-path --tikv v4 # Specify the version via prefix
31-
tiup mirrors local-path --tidb all --pd all # Download all version for specific component
29+
tiup mirror <command> [flags]
30+
Available Commands:
31+
init Initialize an empty repository
32+
sign Add signatures to a manifest file
33+
genkey Generate a new key pair
34+
clone Clone a local mirror from remote mirror and download all selected components
35+
publish Publish a component
3236
Flags:
33-
--overwrite Overwrite the exists tarball
34-
-f, --full Build a full mirrors repository
35-
-a, --arch strings Specify the downloading architecture (default [amd64])
36-
-o, --os strings Specify the downloading os (default [linux,darwin])
37-
--tidb strings Specify the versions for component tidb
38-
--tikv strings Specify the versions for component tikv
39-
--pd strings Specify the versions for component pd
40-
--playground strings Specify the versions for component playground
41-
--client strings Specify the versions for component client
42-
--prometheus strings Specify the versions for component prometheus
43-
--package strings Specify the versions for component package
44-
--grafana strings Specify the versions for component grafana
45-
--alertmanager strings Specify the versions for component alertmanager
46-
--blackbox_exporter strings Specify the versions for component blackbox_exporter
47-
--node_exporter strings Specify the versions for component node_exporter
48-
--pushgateway strings Specify the versions for component pushgateway
49-
--tiflash strings Specify the versions for component tiflash
50-
--drainer strings Specify the versions for component drainer
51-
--pump strings Specify the versions for component pump
52-
--cluster strings Specify the versions for component cluster
53-
--mirrors strings Specify the versions for component mirrors
54-
--bench strings Specify the versions for component bench
55-
--insight strings Specify the versions for component insight
56-
--doc strings Specify the versions for component doc
57-
--ctl strings Specify the versions for component ctl
58-
-h, --help help for tiup
37+
-h, --help help for mirror
38+
--repo string Path to the repository
39+
Global Flags:
40+
--skip-version-check Skip the strict version check, by default a version must be a valid SemVer string
41+
Use "tiup mirror [command] --help" for more information about a command.
5942
```
6043

61-
The basic usage of the `tiup mirrors` command is as follows:
44+
The `tiup mirror clone` command is used to build a local mirror. The basic usage is as follows:
6245

6346
{{< copyable "shell-regular" >}}
6447

6548
```bash
66-
tiup mirrors <target-dir> [global-version] [flags]
49+
tiup mirror clone <target-dir> [global-version] [flags]
6750
```
6851

6952
- `target-dir`: used to specify the directory in which cloned data is stored.
7053
- `global-version`: used to quickly set a global version for all components.
7154

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:
7356

74-
- Determines whether to overwrite local packages
57+
- Determines whether to use prefix matching to match the version when cloning
7558

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.
7760

7861
- Determines whether to use the full clone
7962

8063
If you specify the `--full` flag, you can clone the official mirror fully.
8164

8265
> **Note:**
8366
>
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.
8568
8669
- Determines whether to clone packages from the specific platform
8770

8871
If you want to clone packages only for a specific platform, use `-os` and `-arch` to specify the platform. For example:
8972

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.
9376

9477
- Determines whether to clone a specific version of a package
9578

9679
If you want to clone only one version (not all versions) of a component, use `--<component>=<version>` to specify this version. For example:
9780

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.
10184

10285
## Usage examples
10386

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:
141-
142-
{{< copyable "shell-regular" >}}
143-
144-
```bash
145-
export TIUP_MIRRORS=/path/to/mirror
146-
tiup cluster deploy <cluster-name> <cluster-version> <topology-file>
147-
tiup cluster start <cluster-name>
148-
```
87+
This section introduces the usage examples of the `mirror` command.
14988

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
18190

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.

tiup/tiup-overview.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,11 @@ Available Commands:
6161
update Update tiup components to the latest version
6262
status List the status of instantiated components
6363
clean Clean the data of instantiated components
64+
mirror Manage a repository mirror for TiUP components
6465
help Help about any command or component
6566
66-
Available Components:
67-
playground Bootstrap a local TiDB cluster
68-
client A simple mysql client to connect TiDB
69-
package A toolbox to package tiup component
70-
cluster Deploy a TiDB cluster for production
71-
mirrors Build a local mirrors and download all selected components
72-
bench Benchmark database with different workloads
73-
doc Online document for TiDB
67+
Components Manifest:
68+
use "tiup list" to fetch the latest components manifest
7469
7570
Flags:
7671
-B, --binary <component>[:version] Print binary path of a specific version of a component <component>[:version]
@@ -79,7 +74,7 @@ Flags:
7974
-h, --help help for tiup
8075
--skip-version-check Skip the strict version check, by default a version must be a valid SemVer string
8176
-T, --tag string Specify a tag for component instance
82-
--version version for tiup
77+
-v, --version version for tiup
8378
8479
Component instances with the same "tag" will share a data directory ($TIUP_HOME/data/$tag):
8580
$ tiup --tag mycluster playground
@@ -108,11 +103,11 @@ The output is long but you can focus on only two parts:
108103
- update: used to update the component version
109104
- status: used to view the running history of components
110105
- clean: used to clear the running log of components
106+
- mirror: used to clone a private mirror from the official mirror
111107
- help: used to print out help information
112108
- Available components
113109
- playground: used to start a TiDB cluster locally
114110
- client: used to connect to a TiDB cluster in a local machine
115-
- mirrors: used to clone a private mirror from an official mirror
116111
- cluster: used to deploy a TiDB cluster for production environments
117112
- bench: used to stress test the database
118113
- doc: used to open online document

0 commit comments

Comments
 (0)