tiup deploy 执行报错,创建部署用户 search 失败

{“code”: 1, “error”: “task.env_init.failed: Failed to initialize TiDB environment on remote host ‘10.10.224.51’, cause: module.user.user_add_failed: Failed to create new system user ‘search’ on remote host, cause: executor.ssh.execute_failed: Failed to execute com mand over SSH for ‘search@10.10.224.51:22’ {ssh_stderr: , ssh_stdout: , ssh_command: PATH=$PATH:/usr/bin:/usr/sbin sudo -H -u root bash -c “id -u search > /dev/null 2> &1 || /usr/sbin/useradd -m -s /bin/bash search && echo ‘search ALL=(ALL) NOPASSWD:ALL’ > /etc/sudoers.d/search”}, cause: ssh: handshake failed: ssh: unable to authenti cate, attempted methods [none publickey], no supported methods remain”, “errorVerbose”: “task.env_init.failed: Failed to initialize TiDB environment on remote host ‘10. 10.224.51’, cause: module.user.user_add_failed: Failed to create new system user ‘search’ on remote host, cause: executor.ssh.execute_failed: Failed to execute command over SSH for ‘search@10.10.224.51:22’ {ssh_stderr: , ssh_stdout: , ssh_command: PATH=$PATH:/usr/bin:/usr/sbin sudo -H -u root bash -c “id -u search > /dev/null 2>&1 || /usr/sbin/useradd -m -s /bin/bash search && echo ‘search ALL=(ALL) NOPASSWD:ALL’ > /etc/sudoers.d/search”}, cause: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain\ at github.com/pingcap/tiup/pkg/cluster/executor.(*SSHExecutor).Execute()\ \t/home/jenkins/agent/works pace/tiup-release/pkg/cluster/executor/ssh.go:150\ at github.com/pingcap/tiup/pkg/cluster/module.(*UserModule).Execute()\ \t/home/jenkins/agent/workspace/tiup-release/ pkg/cluster/module/user.go:114\ at github.com/pingcap/tiup/pkg/cluster/task.(*EnvInit).execute()\ \t/home/jenkins/agent/workspace/tiup-release/pkg/cluster/task/env_ini t.go:63\ at github.com/pingcap/tiup/pkg/cluster/task.(*EnvInit).Execute()\ \t/home/jenkins/agent/workspace/tiup-release/pkg/cluster/task/env_init.go:44\ at github.com /pingcap/tiup/pkg/cluster/task.(*Serial).Execute()\ \t/home/jenkins/agent/workspace/tiup-release/pkg/cluster/task/task.go:183\ at github.com/pingcap/tiup/pkg/cluster/t ask.(*StepDisplay).Execute()\ \t/home/jenkins/agent/workspace/tiup-release/pkg/cluster/task/step.go:85\ at github.com/pingcap/tiup/pkg/cluster/task.(*Parallel).Execute .func1()\ \t/home/jenkins/agent/workspace/tiup-release/pkg/cluster/task/task.go:236\ at runtime.goexit()\ \t/usr/local/go/src/runtime/asm_amd64.s:1357”}

你好,

  1. 上传下 debug 日志
  2. 上传下拓扑文件

命令行中 --user 需要配置 sudo 和 免密,可以检查下

拓扑文件中 user: 不是必须 tidb 用户,其会根据 --user 来进行创建和免密、sudo

免密是我们提前设置好的,使用的是密钥 。search用户也是我们提前创建好的

我们有个限制。xshell用root登陆。是不能ssh search的

是有search登陆的xshell 可以 免密search 不知道跟这个有关系吗

–user 使用过 ssh 连接到目标服务器和本身服务器,并创建 user: 用户,user: 用户是集群部署用户,满足 sudo 、免密、ssh 可以登录是前提

我们是用putty管理的用户。search用户已创建完成。免密 sudo都是可以的。但还是报错

你好,

此报错关注的是 --user 使用有sudo 和 免密,可以截图看下

  1. –user 用户 ssh 登录目标服务器看是否需要密码,截图看下
  2. 正常登陆看下使用在对方服务器可以执行 sudo su -并执行报错 shell。

image

已截图!唯一的区别在于 我是直接用search用户登陆的crt。 用root登陆,在切换到search,再ssh是不行的

发下 debug 日志吧。。看下具体执行 deploy 语句是什么

tiup-cluster-debug-2020-06-04-13-36-17.log (82.0 KB)

辛苦上传下拓扑文件,如果 root 密码相同可以使用 tiup cluster deploy tidb-young v4.0.0 ./topology.yaml --user root -p 是否可以正常安装。

辛苦检查下 .ssh 目录权限和 authorized_keys 权限: .ssh 目录必须是 744,authorized_keys 文件必须是 600

root search用户 都是密钥管理。我们不用密码的

topology.yaml (5.2 KB)

信息回复同楼层即可,中控机 ip 是多少,这边确认下报错 ip 是否为中控机本机。

目录权限确认截图可以发出来看下

中控机10.10.224.51

image

你好,

非常感谢你的配合。辛苦在中控机使用 search 用户执行

  1. ssh search@10.10.224.51
  2. sudo su -

topo 文件中显示运维用户为 tidb,与报错信息不符,可以注意下。
image

您好,这个是我备份版本。服务器上的 我已经修改为search了

不用急于回帖,将信息整合一下发出来更好些,先按照上述操作下。

信息发到同楼层即可。避免回帖过多。