安装cluster check的时候提示ssh 错误

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【概述】
ubuntu 20 tidb-v5

【背景】
tiup cluster check topology.yaml -i ~/.ssh/id_rsa --user wangli 这个命令不能运行

【现象】
错误提示
Starting component cluster: /home/wangli/.tiup/components/cluster/v1.4.4/tiup-cluster check topology.yaml -i /home/wangli/.ssh/id_rsa --user wangli -p
Input SSH password:

  • Download necessary tools
    • Downloading check tools for linux/amd64 … Done
  • Collect basic system information
    • Getting system info of 192.168.88.52:22 … Error
    • Getting system info of 192.168.88.51:22 … Error

Error: executor.ssh.execute_failed: Failed to execute command over SSH for ‘wangli@192.168.88.52:22’ {ssh_stderr: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/usr/bin:/usr/sbin sudo -H bash -c “test -d /tmp || (mkdir -p /tmp && chown wangli:$(id -g -n wangli) /tmp)”}, cause: Process exited with status 1

Verbose debug logs has been written to /home/wangli/.tiup/logs/tiup-cluster-debug-2021-06-05-03-37-48.log.
Error: run /home/wangli/.tiup/components/cluster/v1.4.4/tiup-cluster (wd:/home/wangli/.tiup/data/SZQb3KN) failed: exit status 1

【TiDB 版本】
tidb-v5

注意以下两点:
1、topology.yaml的位置,如果是当前位置 改为 ./topology.yaml
2、~/.ssh/id_rsa 路径改为绝对路径试一下
3、需要保证密钥能够成功登陆

注意参考官方示例

tiup cluster check ./topology.yaml --user root [-p] [-i /home/root/.ssh/gcp_rsa]
tiup cluster check ./topology.yaml --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa]

tiup cluster check ./topology.yaml -i /home/wangli/.ssh/id_rsa --user wangli
改成这个,之后,还是错误
Error: executor.ssh.execute_failed: Failed to execute command over SSH for ‘wangli@192.168.88.52:22’ {ssh_stderr: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/usr/bin:/usr/sbin sudo -H bash -c “test -d /tmp || (mkdir -p /tmp && chown wangli:$(id -g -n wangli) /tmp)”}, cause: Process exited with status 1

Verbose debug logs has been written to /home/wangli/.tiup/logs/tiup-cluster-debug-2021-06-05-04-09-12.log.
Error: run /home/wangli/.tiup/components/cluster/v1.4.4/tiup-cluster (wd:/home/wangli/.tiup/data/SZQiygs) failed: exit status 1

试过 ssh wangli@192.168.88.52 ls
是可以运行ls的

参考一下这个帖子

我看了,应该与我的问题差不多。但是里面的大佬只说了检查
/etc/sudoers
的权限设置
我的系统中,wangli,这个用户是安装的时候建的,有sudo的权限,也是主要用的用户。

用创建互信的方式试一下

我在配置文件里面写的就是用wangli用户运行,不是user:tidb,是不是必须用tidb来运行?

这个不是吧,还没到运行那一步。现在只是检查

我也觉得是,应该还是在ssh上的问题。但是系统是很干净的。手动ssh也没问题

先试试互信这种方式

这个文档中说到了关键

visudo
tidb ALL=(ALL) NOPASSWD: ALL

改了之后就好了。
感谢大神

:+1:

:+1:

记得点选【对我有用】方便后面同学定位解决方案哟~

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。