1

my environment is vmware12 + centos6.6 + mysql5.5 + mha4mysql-manager-0.53-0.noarch.rpm + mha4mysql-node-0.53-0.noarch.rpm

my structure is one master three slaves

master  192.168.233.135 node
slave1  192.168.233.132 node
slave2  192.168.233.133 node
slave3  192.168.233.134 node + manager

My root@slave3 to root@master is OK!

[root@slave3 ~]# ssh root@master
Last login: Fri Jun  3 08:03:21 2016 from 192.168.233.134

[root@slave3 ~]# ssh [email protected]
Last login: Fri Jun  3 08:38:00 2016 from 192.168.233.134

but when I use masterha_check_ssh it fails

[root@slave3 ~]# /usr/bin/masterha_check_ssh --conf=/etc/app1.cnf
Tue May 31 17:08:23 2016 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue May 31 17:08:23 2016 - [info] Reading application default configurations from /etc/app1.cnf..
Tue May 31 17:08:23 2016 - [info] Reading server configurations from /etc/app1.cnf..
Tue May 31 17:08:23 2016 - [info] Starting SSH connection tests..
Tue May 31 17:08:26 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/SSHCheck.pm, ln63] 
Tue May 31 17:08:25 2016 - [debug]  Connecting via SSH from root@slave3(192.168.233.134:22) to root@master(192.168.233.135:22)..
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Tue May 31 17:08:26 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/SSHCheck.pm, ln107] SSH connection from root@slave3(192.168.233.134:22) to root@master(192.168.233.135:22) failed!
Tue May 31 17:08:28 2016 - [debug] 
Tue May 31 17:08:24 2016 - [debug]  Connecting via SSH from root@slave1(192.168.233.132:22) to root@master(192.168.233.135:22)..
Tue May 31 17:08:26 2016 - [debug]   ok.
Tue May 31 17:08:26 2016 - [debug]  Connecting via SSH from root@slave1(192.168.233.132:22) to root@slave2(192.168.233.133:22)..
Tue May 31 17:08:26 2016 - [debug]   ok.
Tue May 31 17:08:26 2016 - [debug]  Connecting via SSH from root@slave1(192.168.233.132:22) to root@slave3(192.168.233.134:22)..
Tue May 31 17:08:28 2016 - [debug]   ok.
Tue May 31 17:08:28 2016 - [debug] 
Tue May 31 17:08:23 2016 - [debug]  Connecting via SSH from root@master(192.168.233.135:22) to root@slave1(192.168.233.132:22)..
Tue May 31 17:08:25 2016 - [debug]   ok.
Tue May 31 17:08:25 2016 - [debug]  Connecting via SSH from root@master(192.168.233.135:22) to root@slave2(192.168.233.133:22)..
Tue May 31 17:08:26 2016 - [debug]   ok.
Tue May 31 17:08:26 2016 - [debug]  Connecting via SSH from root@master(192.168.233.135:22) to root@slave3(192.168.233.134:22)..
Tue May 31 17:08:28 2016 - [debug]   ok.
Tue May 31 17:08:28 2016 - [debug] 
Tue May 31 17:08:24 2016 - [debug]  Connecting via SSH from root@slave2(192.168.233.133:22) to root@master(192.168.233.135:22)..
Tue May 31 17:08:26 2016 - [debug]   ok.
Tue May 31 17:08:26 2016 - [debug]  Connecting via SSH from root@slave2(192.168.233.133:22) to root@slave1(192.168.233.132:22)..
Tue May 31 17:08:27 2016 - [debug]   ok.
Tue May 31 17:08:27 2016 - [debug]  Connecting via SSH from root@slave2(192.168.233.133:22) to root@slave3(192.168.233.134:22)..
Tue May 31 17:08:28 2016 - [debug]   ok.
SSH Configuration Check Failed!
 at /usr/bin/masterha_check_ssh line 44

and my /etc/app1.cnf is

[root@slave3 ~]# cat /etc/app1.cnf

  [server default]
  user=root
  password=123456
  ssh_user=root
  master_binlog_dir= /data/mysql3306/logs/
  remote_workdir=/tmp
  secondary_check_script= /usr/bin/masterha_secondary_check -s slave3-s slave2
  ping_interval=3
  master_ip_failover_script=/script/masterha/master_ip_failover
  shutdown_script= /script/masterha/power_manager
  report_script= /script/masterha/send_master_failover_mail
  manager_workdir=/var/log/masterha/app1
  manager_log=/var/log/masterha/app1/app1.log

  [server1]
  hostname=master

  [server2]
  hostname=slave1
  candidate_master=1

  [server3]
  hostname=slave2
  candidate_master=1  

  [server4]
  hostname=slave3
  no_master=1
1
  • You can let the sshd on the target machine run in debug foreground and see what it gets offered and rejects.
    – eckes
    Commented May 24, 2019 at 19:25

1 Answer 1

0

I just encountered the above error and discovered where I got it wrong.

The content of id_rsa.pub file on slave3 (which is your manager node) also but be copied over to your authorized_keys file to enable passwordless ssh into slave3. Once I copied public ssh key (id_rsa.pub) into authorized_key, the error was gone. To confirm this, you should run ssh [email protected] on slave3 to confirm you are able to ssh into slave3 as root without a password.

1
  • The question shows that ssh works
    – eckes
    Commented May 24, 2019 at 5:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.