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

Add document for tiup-cluster #4066

Merged
merged 6 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
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
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
34 changes: 34 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,29 @@ 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

写一个就好了

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

都写上吧。。。QA 测试也好参考一下

export TIUP_NATIVE_SSH=true
# 或者
export TIUP_NATIVE_SSh=1
# 或者
export TIUP_NATIVE_SSH=enable
```

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

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