Skip to content

Commit 12998d3

Browse files
committed
Finish the command section
1 parent 8dc119c commit 12998d3

File tree

7 files changed

+186
-5
lines changed

7 files changed

+186
-5
lines changed

tiup/tiup-command-completion.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: tiup completion
3+
aliases: ['/docs-cn/dev/tiup/tiup-command-completion/']
4+
---
5+
6+
# tiup completion
7+
8+
## 介绍
9+
10+
为了记忆命令的心智负担,TiUP 提供了 `tiup completion` 命令用于生成命令行自动补全的配置文件,目前支持 `bash``zsh` 两种 shell 的命令补全。
11+
12+
如果是 bash,需要提前安装好 bash-completion:
13+
14+
- macOS 的安装方式为:`brew install bash-completion` 或者 `brew install bash-completion@2`(Bash 4.1+)
15+
- Linux 的安装方式为:使用包管理器安装 `bash-completion`
16+
17+
## 语法
18+
19+
```sh
20+
tiup completion <shell>
21+
```
22+
23+
`<shell>` 为 shell 类型,目前支持 `bash``zsh`
24+
25+
## 使用方式
26+
27+
### bash
28+
29+
将自动补全代码写入一个文件,并且在 .bash_profile 中 source 之:
30+
31+
```sh
32+
tiup completion bash > ~/.completion.bash.inc
33+
34+
printf "
35+
# tiup shell completion
36+
source '$HOME/.completion.bash.inc'
37+
" >> $HOME/.bash_profile
38+
39+
source $HOME/.bash_profile
40+
```
41+
42+
### zsh
43+
44+
```sh
45+
tiup completion zsh > "${fpath[1]}/_tiup"
46+
```

tiup/tiup-command-env.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: tiup env
3+
aliases: ['/docs-cn/dev/tiup/tiup-command-env/']
4+
---
5+
6+
# tiup env
7+
8+
## 介绍
9+
10+
TiUP 为用户提供了灵活的定制化接口,其中一部分是使用环境变量来实现的,命令 `tiup env` 用于查询 TiUP 支持用户自定义的环境变量以及它们此时的值。
11+
12+
## 语法
13+
14+
```sh
15+
tiup env [name1...N]
16+
```
17+
18+
`[name1...N]` 用于查看指定的环境变量,若不指定,则查看所有支持的环境变量。
19+
20+
## 选项
21+
22+
23+
24+
## 输出
25+
26+
- 若未指定 `[name1...N]`,则输出 "{key}"="{value}" 列表
27+
- 若指定了 `[name1...N]`,则按顺序输出 "{value}" 列表
28+
29+
以上输出若 value 为空则代表其未设置,TiUP 会采用默认行为。

tiup/tiup-command-help.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: tiup help
3+
aliases: ['/docs-cn/dev/tiup/tiup-command-help/']
4+
---
5+
6+
# tiup help
7+
8+
## 介绍
9+
10+
TiUP 在命令行界面为用户提供了丰富的帮助信息,这些帮助信息可以通过 `help` 命令或者 `--help` 参数获得,基本上,`tiup help <command>` 等价于 `tiup <command> --help`
11+
12+
## 语法
13+
14+
```sh
15+
tiup help [command]
16+
```
17+
18+
`[command]` 用于指定要查看哪个命令的帮助信息,若不指定,则查看 TiUP 自身的帮助信息。
19+
20+
## 选项
21+
22+
23+
24+
## 输出
25+
26+
`[command]` 或 TiUP 的帮助信息。

tiup/tiup-command-mirror-merge.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: tiup mirror merge
3+
aliases: ['/docs-cn/dev/tiup/tiup-command-mirror-merge/']
4+
---
5+
6+
# tiup mirror merge
7+
8+
## 介绍
9+
10+
命令 `tiup mirror merge` 用于合并一个或多个镜像到当前镜像。在合并之前,需要使用命令 [tiup mirror set](/tiup/tiup-command-mirror-set.md) 指定当一个有权限发布组件的前镜像。
11+
12+
执行此命令需要满足几个条件:
13+
14+
- 目标镜像的所有组件的管理员 ID 必须在当前镜像中存在
15+
- 执行该命令的用户的 `${TIUP_HOME}/keys` 目录中有上述管理员 ID 在当前镜像中对应的所有的私钥
16+
17+
## 语法
18+
19+
```sh
20+
tiup mirror merge <mirror-dir-1> [mirror-dir-N] [flags]
21+
```
22+
23+
- `<mirror-dir-1>`:要合并到当前镜像的第一个镜像
24+
- `[mirror-dir-N]`:要合并到当前镜像的第 N 个镜像
25+
26+
## 选项
27+
28+
29+
30+
## 输出
31+
32+
- 成功:无输出
33+
- 当前镜像缺失目标镜像某个组件的管理员,或 `${TIUP_HOME}/keys` 缺失该管理员的私钥:`Error: missing owner keys for owner %s on component %s`

tiup/tiup-command-mirror.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ tiup mirror <command> [flags]
3737
- [modify](/tiup/tiup-command-mirror-modify.md): 修改当前镜像中的组件属性
3838
- [rotate](/tiup/tiup-command-mirror-rotate.md): 更新当前镜像中的根证书
3939
- [clone](/tiup/tiup-command-mirror-rotate.md): 从已有镜像克隆一个新的镜像
40-
- merge: 合并两个或多个镜像
40+
- [merge](/tiup/tiup-command-mirror-merge.md): 合并镜像

tiup/tiup-command-telemetry.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: tiup telemetry
3+
aliases: ['/docs-cn/dev/tiup/tiup-command-telemetry/']
4+
---
5+
6+
# tiup telemetry
7+
8+
## 介绍
9+
10+
TiDB、TiUP 及 TiDB Dashboard 默认会收集使用情况信息,并将这些信息分享给 PingCAP 用于改善产品,例如,通过这些使用情况信息,PingCAP 可以了解常见的 TiDB 集群操作,从而确定新功能优先级。
11+
12+
当 TiUP 遥测功能开启时,执行 TiUP 命令时将会将使用情况信息分享给 PingCAP,包括(但不限于):
13+
14+
- 随机生成的遥测标示符
15+
- TiUP 命令的执行情况,如命令执行是否成功、命令执行耗时等
16+
- 使用 TiUP 进行部署的情况,如部署的目标机器硬件信息、组件版本号、修改过的部署配置名称等
17+
18+
TiUP 使用命令 `tiup telemetry` 来控制遥测。
19+
20+
## 语法
21+
22+
```sh
23+
tiup telemetry <command>
24+
```
25+
26+
`<command>` 代表子命令,支持的子命令列表请参考下方命令一节。
27+
28+
## 命令
29+
30+
### status
31+
32+
命令 `tiup telemetry status` 查看当前的遥测设置,输出以下信息:
33+
34+
- status: 当前是否开启遥测(enable|disable)
35+
- uuid: 随机生成的遥测标示符
36+
37+
### reset
38+
39+
命令 `tiup telemetry reset` 重置当前的遥测标示符,以一个新的随机标识符代替之。
40+
41+
### enable
42+
43+
命令 `tiup telemetry enable` 启用遥测。
44+
45+
### disable
46+
47+
命令 `tiup telemetry disable` 停用遥测。

tiup/tiup-reference.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ tiup [flags] <component> [args...] # 运行组件
9898
- [status](/tiup/tiup-command-status.md):查看组件运行状态
9999
- [clean](/tiup/tiup-command-clean.md):清理组件数据目录
100100
- [mirror](/tiup/tiup-command-mirror.md):镜像管理
101-
- telemetry:遥测开关
102-
- completion:TiUP 命令补全
103-
- env:查看 TiUP 相关环境变量
104-
- help:查看特定命令或组件的帮助文档
101+
- [telemetry](/tiup/tiup-command-telemetry.md):遥测开关
102+
- [completion](/tiup/tiup-command-completion.md):TiUP 命令补全
103+
- [env](/tiup/tiup-command-env.md):查看 TiUP 相关环境变量
104+
- [help](/tiup/tiup-command-help.md):查看特定命令或组件的帮助文档
105105

106106
## 组件清单
107107

0 commit comments

Comments
 (0)