tidb集群添加服务后,执行命令:tiup cluster reload tidb-test 抛异常

【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】5.4
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】error: init config failed: mt1010:2379: transfer from /root/.tiup/storage/cluster/clusters/tidb-test/config-cache/pd-mt1010-2379.service to /tmp/pd_335adcbd-631d-45fb-acd5-e296898abb06.service failed: executor.ssh.execute_failed: Failed to transfer file over SCP for ‘tidb@mt1010:9922’ {ssh_stderr: Authentication failed. lost connection , ssh_stdout: , ssh_command: scp -r -o StrictHostKeyChecking=no -P 9922 -o ConnectTimeout=5 -i /root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa /root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa /root/.tiup/storage/cluster/clusters/tidb-test/config-cache/pd-gwmidc1010-2379.service tidb@mt1010:/tmp/pd_335adcbd-631d-45fb-acd5-e296898abb06.service}, cause: exit status 1
【资源配置】
【附件:截图/日志/监控】

报错提示scp失败,测试下ssh互信是不是出问题了

ssh互信没有问题,节点间互相跳转没有问题,root 和tidb用户我都做了免密

原因是/tmp 权限不足,你可以手动在中控节点执行:
scp -r -o StrictHostKeyChecking=no -P 9922 -o ConnectTimeout=5 -i /root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa /root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa /root/.tiup/storage/cluster/clusters/tidb-test/config-cache/pd-gwmidc1010-2379.service tidb@mt1010:/tmp/pd_335adcbd-631d-45fb-acd5-e296898abb06.service

我刚试了下这个scp命令,我的安装和使用都是用的是root的用户,但是这个scp是tidb用户,我不太明白这个是为什么

tiup如果没有指定用户就默认使用当前用户。

但是从这个报错来看我它分发这个文件使用的是tidb用户,扩缩容的时候是需要指定某个用户么

我试试

tidb 的免密最好用tiup自己生成的

看报错是ssh连接问题

tidb和root用户之间也做免密,将tidb 和root用户下的公钥分别放到对方的authorized_keys中,按此方法已解决。

将root用户下的公钥私钥拷贝到tiup目录下,重新执行tiup cluster reload tidb-pro
cp /root/.ssh/id_rsa /home/tidb/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa
cp /root/.ssh/authorized_keys /home/tidb/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa.pub
通过该方法已解决