安装mysql mha执行masterha_check_ssh时报错Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password

复制代码
问题描述:安装mysql mha执行masterha_check_ssh时报错Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password),如下所示:
系统:rhel 7.9 64位
mha安装包:mha4mysql-node-0.58.tar.gz、mha4mysql-manager-0.58.tar.gz
数据库:mysql 5.7.21
1、问题重现
[root@mha-manager ~]# masterha_check_ssh -conf=/etc/masterha/app1.cnf
Sun Jun 30 10:15:57 2024 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun Jun 30 10:15:57 2024 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Sun Jun 30 10:15:57 2024 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Sun Jun 30 10:15:57 2024 - [info] Starting SSH connection tests..
Sun Jun 30 10:15:58 2024 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln63] 
Sun Jun 30 10:15:57 2024 - [debug]  Connecting via SSH from root@192.168.133.70(192.168.133.70:22) to root@192.168.133.71(192.168.133.71:22)..
Warning: Permanently added '192.168.133.70' (ECDSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Sun Jun 30 10:15:57 2024 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln111] SSH connection from root@192.168.133.70(192.168.133.70:22) to root@192.168.133.71(192.168.133.71:22) failed!
Sun Jun 30 10:15:58 2024 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln63] 
Sun Jun 30 10:15:58 2024 - [debug]  Connecting via SSH from root@192.168.133.71(192.168.133.71:22) to root@192.168.133.70(192.168.133.70:22)..
Warning: Permanently added '192.168.133.70' (ECDSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Sun Jun 30 10:15:58 2024 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln111] SSH connection from root@192.168.133.71(192.168.133.71:22) to root@192.168.133.70(192.168.133.70:22) failed!
Sun Jun 30 10:15:59 2024 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln63] 
Sun Jun 30 10:15:58 2024 - [debug]  Connecting via SSH from root@192.168.133.72(192.168.133.72:22) to root@192.168.133.70(192.168.133.70:22)..
Warning: Permanently added '192.168.133.70' (ECDSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Sun Jun 30 10:15:58 2024 - [error][/usr/local/share/perl5/MHA/SSHCheck.pm, ln111] SSH connection from root@192.168.133.72(192.168.133.72:22) to root@192.168.133.70(192.168.133.70:22) failed!
SSH Configuration Check Failed!
 at /usr/local/bin/masterha_check_ssh line 44.
 
2、异常原因
从192.168.133.70通过ssh到192.168.133.71报错,MHA在连接时会先跟自己测试连接.

3、解决方案
[root@mha-manager ~]# ssh-copy-id 192.168.133.70
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.133.70's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '192.168.133.70'"
and check to make sure that only the key(s) you wanted were added.

[root@mha-manager ~]# ssh root@192.168.133.70
Last login: Sun Jun 30 10:29:35 2024 from 192.168.133.70

说明:确保manager节点和三个数据库节点互信无问题,最好ssh root@本机IP 无问题.
 
 4、验证
 --再次执行masterha_check_ssh,显示成功.
[root@mha-manager ~]# masterha_check_ssh -conf=/etc/masterha/app1.cnf
Sun Jun 30 10:38:20 2024 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun Jun 30 10:38:20 2024 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Sun Jun 30 10:38:20 2024 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Sun Jun 30 10:38:20 2024 - [info] Starting SSH connection tests..
Sun Jun 30 10:38:21 2024 - [debug] 
Sun Jun 30 10:38:20 2024 - [debug]  Connecting via SSH from root@192.168.133.70(192.168.133.70:22) to root@192.168.133.71(192.168.133.71:22)..
Sun Jun 30 10:38:20 2024 - [debug]   ok.
Sun Jun 30 10:38:20 2024 - [debug]  Connecting via SSH from root@192.168.133.70(192.168.133.70:22) to root@192.168.133.72(192.168.133.72:22)..
Sun Jun 30 10:38:21 2024 - [debug]   ok.
Sun Jun 30 10:38:22 2024 - [debug] 
Sun Jun 30 10:38:21 2024 - [debug]  Connecting via SSH from root@192.168.133.71(192.168.133.71:22) to root@192.168.133.70(192.168.133.70:22)..
Sun Jun 30 10:38:21 2024 - [debug]   ok.
Sun Jun 30 10:38:21 2024 - [debug]  Connecting via SSH from root@192.168.133.71(192.168.133.71:22) to root@192.168.133.72(192.168.133.72:22)..
Sun Jun 30 10:38:21 2024 - [debug]   ok.
Sun Jun 30 10:38:23 2024 - [debug] 
Sun Jun 30 10:38:21 2024 - [debug]  Connecting via SSH from root@192.168.133.72(192.168.133.72:22) to root@192.168.133.70(192.168.133.70:22)..
Sun Jun 30 10:38:21 2024 - [debug]   ok.
Sun Jun 30 10:38:21 2024 - [debug]  Connecting via SSH from root@192.168.133.72(192.168.133.72:22) to root@192.168.133.71(192.168.133.71:22)..
Sun Jun 30 10:38:22 2024 - [debug]   ok.
Sun Jun 30 10:38:23 2024 - [info] All SSH connection tests passed successfully.
复制代码

 

posted on   数据与人文  阅读(16)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示