【 TiDB 使用环境】生产环境 /测试/ Poc
生产环境
【 TiDB 版本】V8.5.1
【复现路径】
新部署
【遇到的问题:问题现象及影响】
tiup中控机部署在192.168.1.11 的tidb用户下,子节点是192.168.1.90,在11服务器和90服务器之间已经做了互信,90机器可以通过免密sudo执行命令,但是执行 tiup cluster check ./topology.yaml --user tidb 命令,提示报错"executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.1.90:22’ {ssh_stderr: , ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c "sysctl -a"}, cause: ssh: handshake failed: read tcp 192.168.1.11:41362->192.168.1.90:22: read: connection reset by peer", 使用的服务器是云服务器,都是新机器,这两台机器在同一个安全组内,尝试在90服务器上启动测试程序占用9100端口,11服务器可以使用telnet 命令跑通,各位大佬,帮忙看看还有什么排查思路
【资源配置】进入到 TiDB Dashboard -集
tiup-cluster-debug-2025-05-25-23-19-40.log (57.4 KB)
群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
能用root用户吗,用root用户装简单很多,不用建tidb用户自动创建的
192.168.1.11 你配置的是90地址,报错的是192.168.1.108:22 你测试了11上ssh tidb@192.168.1.108了吗
不好意思,我换了几台机器测试来着,报错应该是粘错了
root用户可以用,是在11 机器上用root用户部署tiup,然后再check的时候,通过 --user root指定 用户吗?
–user root -p 手输密码
我有个疑问,我在测试的时候,使用–concurrency 1 这个参数,发下日志可以正常执行sysctl -a,但是执行ss -lt不行,这是不是服务器本身某些配置有问题呢
遇到过应该是网络问题,或者ssh配置免密登陆的问题。
网络问题的话,有没有排查思路?
不应该啊,你指定tidb用户check,为什么实际ssh登的是root?你的拓扑文件里面是不是写了些多余的东西,指定了要用root?
因为运行多次,把信息搞混了,尝试使用root或者tidb用户都操作来着
yaml文件发一下
看了一下你上传的日志,执行部署用tidb的时候需要配置的地方很多,我之前也踩过很多坑。执行部署用root就好一些。
首先一点就是 tidb用户下,中控机到目标部署机器 root及tidb用户免密
部署机器也得确保 sudo 的时候不需要输入密码校验
你的日志里面创建目录的时候就失败了,后续部署不会成功的,权限不足的样子
2025-05-25T23:14:08.252+0800 | ERROR | SSHCommand | {host: 192.168.1.90, port: 22, cmd: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin; /usr/bin/sudo -H bash -c [ -e /tidb-deploy/pd-2379 ] && echo 1, error: Process exited with status 1, stdout: , stderr: } |
---|---|---|---|
2025-05-25T23:14:08.252+0800 | ERROR | CheckPoint | {host: 192.168.1.90, port: 22, user: tidb, sudo: false, cmd: [ -e /tidb-deploy/pd-2379 ] && echo 1, stdout: , stderr: , error: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.1.90:22’ {ssh_stderr: , ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin; /usr/bin/sudo -H bash -c [ -e /tidb-deploy/pd-2379 ] && echo 1}, cause: Process exited with status 1, errorVerbose: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.1.90:22’ {ssh_stderr: , ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin; /usr/bin/sudo -H bash -c [ -e /tidb-deploy/pd-2379 ] && echo 1}, cause: Process exited with status 1\n at github.com/pingcap/tiup/pkg/cluster/executor.(*EasySSHExecutor).Execute()\n\tgithub.com/pingcap/tiup/pkg/cluster/executor/ssh.go:174\n at github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute()\n\tgithub.com/pingcap/tiup/pkg/cluster/executor/checkpoint.go:86\n at github.com/pingcap/tiup/pkg/cluster/operation.CheckDirIsExist()\n\tgithub.com/pingcap/tiup/pkg/cluster/operation/check.go:941\n at github.com/pingcap/tiup/pkg/cluster/task.(*CheckSys).Execute()\n\tgithub.com/pingcap/tiup/pkg/cluster/task/check.go:161\n at github.com/pingcap/tiup/pkg/cluster/task.(*Serial).Execute()\n\tgithub.com/pingcap/tiup/pkg/cluster/task/task.go:86\n at github.com/pingcap/tiup/pkg/cluster/task.(*StepDisplay).Execute()\n\tgithub.com/pingcap/tiup/pkg/cluster/task/step.go:111\n at github.com/pingcap/tiup/pkg/cluster/task.(*Parallel).Execute.func1()\n\tgithub.com/pingcap/tiup/pkg/cluster/task/task.go:144\n at runtime.goexit()\n\truntime/asm_amd64.s:1650, hash: 775384c48a95f7047c016cbf2905eec1e267f629, func: github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute, hit: false} |
2025-05-25T23:14:08.252+0800 | DEBUG | TaskFinish | {task: CheckSys: host=192.168.1.90 type=exist} |
tiup-cluster-debug-2025-05-27-10-23-30.log (56.1 KB)
这是我换成6.5.1版本后尝试的最新的日志,切换成root用户部署的tiup,检查check的时候指定root用户,但是还是报错,手工尝试使用ssh 192.168.1.90 是正常免密登录的
90上 tidb 用户 可以sudo -i 免密切换到root用户吗
这时候两台机器上的tidb用户都使用 userdel -r tidb 删除了,不是说tiup会自动创建tidb用户么
先看下网络是否通,然后做免密登陆验证,这样就可以了。
可以使用普通账号来进行相关的验证就可以了。
tiup-cluster-debug-2025-05-27-11-39-49.log (25.4 KB)
这次我使用root账号,使用–ssh system指定使用系统的ssh操作,但是执行 /tmp/tiup/bin/insight 脚本报错,但是我手工使用 sshpass 命令可以正常执行