Skip to content

Commit

Permalink
Add document for tiup-cluster
Browse files Browse the repository at this point in the history
document for pingcap/tiup#615

Signed-off-by: lucklove <[email protected]>
  • Loading branch information
lucklove committed Jul 28, 2020
1 parent 60ddb9e commit a65e377
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions maintain-tidb-using-tiup.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ Flags:
--transfer-timeout int transfer leader 的超时时间
Global Flags:
--native-ssh 使用系统默认的 SSH 客户端
--wait-timeout int 等待操作超时的时间
--ssh-timeout int SSH 连接的超时时间
-y, --yes 跳过所有的确认步骤
```
Expand Down
33 changes: 33 additions & 0 deletions tiup/tiup-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Available Commands:
Flags:
-h, --help 帮助信息
--native-ssh 使用系统默认的 SSH 客户端
--wait-timeout int 等待操作超时的时间
--ssh-timeout int SSH 连接超时时间
-y, --yes 跳过所有的确认步骤
```
Expand Down Expand Up @@ -329,6 +331,8 @@ Flags:
--transfer-timeout int transfer leader 的超时时间
Global Flags:
--native-ssh 使用系统默认的 SSH 客户端
--wait-timeout int 等待操作超时的时间
--ssh-timeout int SSH 连接的超时时间
-y, --yes 跳过所有的确认步骤
```
Expand Down Expand Up @@ -385,6 +389,8 @@ Flags:
--transfer-timeout int transfer leader 的超时时间

Global Flags:
--native-ssh 使用系统默认的 SSH 客户端
--wait-timeout int 等待操作超时的时间
--ssh-timeout int SSH 连接的超时时间
-y, --yes 跳过所有的确认步骤
```
Expand Down Expand Up @@ -429,6 +435,8 @@ Flags:
-r, --rename NAME 重命名被导入的集群
Global Flags:
--native-ssh 使用系统默认的 SSH 客户端
--wait-timeout int 等待操作超时的时间
--ssh-timeout int SSH 连接的超时时间
-y, --yes 跳过所有的确认步骤
```
Expand Down Expand Up @@ -582,3 +590,28 @@ tiup cluster check <cluster-name> --cluster
在运行检测时,若指定了 `--apply` 参数,程序将尝试对其中未通过的项目自动修复。自动修复仅限于部分可通过修改配置或系统参数调整的项目,其它未修复的项目需要根据实际情况手工处理。

环境检查不是部署集群的必需流程。对于生产环境建议在部署前执行环境检查并通过所有检测项。如果未通过全部检查项,也可能正常部署和运行集群,但可能无法获得最佳性能表现。

## 使用中控机系统自带的 SSH 客户端连接集群

在以上所有操作中,涉及到对集群机器的操作都是通过 TiUP 内置的 SSH 客户端连接集群,但是在某些场景下,我们需要使用系统自带的 SSH 客户端来对集群执行操作,这时候我们可以使用 `--native-ssh` 参数,例如:

- 部署集群: `tiup cluster deploy <cluster-name> <version> <topo> --native-ssh`
- 启动集群: `tiup cluster start <cluster-name> --native-ssh`
- 升级集群: `tiup cluster upgrade ... --native-ssh`

所有涉及集群操作的步骤都可以加上 `--native-ssh` 来使用系统自带的客户端。

如果觉得这样每个命令都加 `--native-ssh` 太冗余,我们可以使用环境变量来指定:
```sh
export TIUP_NATIVE_SSH=true
# 或者
export TIUP_NATIVE_SSh=1
# 或者
export TIUP_NATIVE_SSH=enable
```

若环境变量和 `--native-ssh` 同时指定,则以 `--native-ssh` 为准。

> **注意:**
>
> 在 deploy 步骤中,若需要使用密码的方式连接 (-p),或者密钥文件设置了 passphrase,则需要保证中控机上安装了 sshpass,否则连接时会报错。

0 comments on commit a65e377

Please sign in to comment.