报错信息:
Error: failed to stop alertmanager: failed to stop: 192.168.100.1 alertmanager-9093.service, please check the instance’s log(/home/data/tidb-deploy/alertmanager-9093/log) for more detail.: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.100.1:22’ {ssh_stderr: , ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c “systemctl daemon-reload && systemctl stop alertmanager-9093.service”}, cause: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
报错原因:
ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
解决方法:
- 查看当前tiup部署时存放的私钥位置
tiup cluster list
[root@localhost .tiup]# tiup cluster list
tiup is checking updates for component cluster ...
Starting component `cluster`: /root/.tiup/components/cluster/v1.12.2/tiup-cluster list
Name User Version Path PrivateKey
---- ---- ------- ---- ----------
tidb-test tidb v7.1.0 /root/.tiup/storage/cluster/clusters/tidb-test /root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa
私钥目录存放在 /root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa
- 将tiup用户目录下的私钥覆盖至此处即可(如果没有则需要手动ssh-gen下,网上大部分都是教到这里,但还是不解决问题,一般都是visudo然后添加tidb用户权限,生成公钥私钥)
su - tidb
cd .ssh
cp id_rsa /root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa
cp authorized_keys /root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa.pub
这里的关键点是覆盖你安装时指定的私钥目录文件,大部分教程都没提及此处。
tiup cluster reload --ssh system tidb-test
完事~~