From 04bf2b6a69ab100d74bc9d34d6be9636688106f8 Mon Sep 17 00:00:00 2001 From: lucklove Date: Tue, 28 Jul 2020 11:49:13 +0800 Subject: [PATCH 1/4] Add document for tiup-cluster document for https://github.com/pingcap/tiup/pull/615 Signed-off-by: lucklove --- maintain-tidb-using-tiup.md | 2 ++ tiup/tiup-cluster.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) 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 From c4d6b03592a7488fa5fac926b4788a69084bc840 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Tue, 28 Jul 2020 16:00:19 +0800 Subject: [PATCH 2/4] Update tiup/tiup-cluster.md Co-authored-by: Lonng --- tiup/tiup-cluster.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index 240702353278..4e069ceb2eaa 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -601,7 +601,7 @@ tiup cluster check --cluster 所有涉及集群操作的步骤都可以加上 `--native-ssh` 来使用系统自带的客户端。 -如果觉得这样每个命令都加 `--native-ssh` 太冗余,我们可以使用环境变量来指定: +也可以使用环境变量 `TIUP_NATIVE_SSH` 来指定是否使用本地 SSH 客户端,避免每个命令都需要添加 `--native-ssh` 参数: ```sh export TIUP_NATIVE_SSH=true @@ -615,4 +615,4 @@ export TIUP_NATIVE_SSH=enable > **注意:** > -> 在 deploy 步骤中,若需要使用密码的方式连接 (-p),或者密钥文件设置了 passphrase,则需要保证中控机上安装了 sshpass,否则连接时会报错。 \ No newline at end of file +> 在 deploy 步骤中,若需要使用密码的方式连接 (-p),或者密钥文件设置了 passphrase,则需要保证中控机上安装了 sshpass,否则连接时会报错。 From d81f489db33505c7f93b0d5bf540834e8a06e27e Mon Sep 17 00:00:00 2001 From: lucklove Date: Tue, 28 Jul 2020 16:25:11 +0800 Subject: [PATCH 3/4] Address comment Signed-off-by: lucklove --- tiup/tiup-cluster.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index 4e069ceb2eaa..747e95acabc5 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -593,7 +593,12 @@ tiup cluster check --cluster ## 使用中控机系统自带的 SSH 客户端连接集群 -在以上所有操作中,涉及到对集群机器的操作都是通过 TiUP 内置的 SSH 客户端连接集群,但是在某些场景下,我们需要使用系统自带的 SSH 客户端来对集群执行操作,这时候我们可以使用 `--native-ssh` 参数,例如: +在以上所有操作中,涉及到对集群机器的操作都是通过 TiUP 内置的 SSH 客户端连接集群执行命令,但是在某些场景下,需要使用系统自带的 SSH 客户端来对集群执行操作,比如: + +- 使用 SSH 插件来做认证 +- 使用定制的 SSH 客户端 + +此时可以通过命令行参数 `--native-ssh` 启用系统自带命令行: - 部署集群: `tiup cluster deploy --native-ssh` - 启动集群: `tiup cluster start --native-ssh` From 813ca4cf5d677311c25c08521835088928cc81bb Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Tue, 28 Jul 2020 19:47:33 +0800 Subject: [PATCH 4/4] Update tiup/tiup-cluster.md --- tiup/tiup-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index 747e95acabc5..9f535094c941 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -620,4 +620,4 @@ export TIUP_NATIVE_SSH=enable > **注意:** > -> 在 deploy 步骤中,若需要使用密码的方式连接 (-p),或者密钥文件设置了 passphrase,则需要保证中控机上安装了 sshpass,否则连接时会报错。 +> 在部署集群的步骤中,若需要使用密码的方式连接 (-p),或者密钥文件设置了 passphrase,则需要保证中控机上安装了 sshpass,否则连接时会报错。