diff --git a/maintain-tidb-using-tiup.md b/maintain-tidb-using-tiup.md index 8f73c8ccdb94..82f080ef7930 100644 --- a/maintain-tidb-using-tiup.md +++ b/maintain-tidb-using-tiup.md @@ -147,6 +147,8 @@ Flags: --transfer-timeout int transfer leader 的超时时间 Global Flags: + --native-ssh 使用系统默认的 SSH 客户端 + --wait-timeout int 等待操作超时的时间 --ssh-timeout int SSH 连接的超时时间 -y, --yes 跳过所有的确认步骤 ``` diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index e6a87de6585f..240702353278 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -46,6 +46,8 @@ Available Commands: Flags: -h, --help 帮助信息 + --native-ssh 使用系统默认的 SSH 客户端 + --wait-timeout int 等待操作超时的时间 --ssh-timeout int SSH 连接超时时间 -y, --yes 跳过所有的确认步骤 ``` @@ -329,6 +331,8 @@ Flags: --transfer-timeout int transfer leader 的超时时间 Global Flags: + --native-ssh 使用系统默认的 SSH 客户端 + --wait-timeout int 等待操作超时的时间 --ssh-timeout int SSH 连接的超时时间 -y, --yes 跳过所有的确认步骤 ``` @@ -385,6 +389,8 @@ Flags: --transfer-timeout int transfer leader 的超时时间 Global Flags: + --native-ssh 使用系统默认的 SSH 客户端 + --wait-timeout int 等待操作超时的时间 --ssh-timeout int SSH 连接的超时时间 -y, --yes 跳过所有的确认步骤 ``` @@ -429,6 +435,8 @@ Flags: -r, --rename NAME 重命名被导入的集群 Global Flags: + --native-ssh 使用系统默认的 SSH 客户端 + --wait-timeout int 等待操作超时的时间 --ssh-timeout int SSH 连接的超时时间 -y, --yes 跳过所有的确认步骤 ``` @@ -582,3 +590,29 @@ tiup cluster check --cluster 在运行检测时,若指定了 `--apply` 参数,程序将尝试对其中未通过的项目自动修复。自动修复仅限于部分可通过修改配置或系统参数调整的项目,其它未修复的项目需要根据实际情况手工处理。 环境检查不是部署集群的必需流程。对于生产环境建议在部署前执行环境检查并通过所有检测项。如果未通过全部检查项,也可能正常部署和运行集群,但可能无法获得最佳性能表现。 + +## 使用中控机系统自带的 SSH 客户端连接集群 + +在以上所有操作中,涉及到对集群机器的操作都是通过 TiUP 内置的 SSH 客户端连接集群,但是在某些场景下,我们需要使用系统自带的 SSH 客户端来对集群执行操作,这时候我们可以使用 `--native-ssh` 参数,例如: + +- 部署集群: `tiup cluster deploy --native-ssh` +- 启动集群: `tiup cluster start --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,否则连接时会报错。 \ No newline at end of file