MHA's Mistakes Summary

There are many tutorials on MHA building online, so I won't go into details. Reference: http://www.cnblogs.com/gomysql/p/3675429.html

Environment installation: centos7 builds MHA
and installs the manger node to install dependent packages. If you download the missing package name according to the error message, the possibility of installation failure is relatively high (lessons summary)
Error 1:

[root@localhost ~]# yum -y install mha4mysql-manager-0.58-0.el7.centos.noarch.rpm
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Examining mha4mysql-manager-0.58-0.el7.centos.noarch.rpm: mha4mysql-manager-0.58-0.el7.centos.noarch
Marking mha4mysql-manager-0.58-0.el7.centos.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mha4mysql-manager.noarch 0:0.58-0.el7.centos will be installed
--> Processing Dependency: perl(Log::Dispatch) for package: mha4mysql-manager-0.58-0.el7.centos.noarch
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
--> Processing Dependency: perl(Log::Dispatch) for package: mha4mysql-manager-0.58-0.el7.centos.noarch
--> Processing Dependency: perl(Log::Dispatch::File) for package: mha4mysql-manager-0.58-0.el7.centos.noarch
--> Processing Dependency: perl(Log::Dispatch::Screen) for package: mha4mysql-manager-0.58-0.el7.centos.noarch
--> Finished Dependency Resolution
Error: Package: mha4mysql-manager-0.58-0.el7.centos.noarch (/mha4mysql-manager-0.58-0.el7.centos.noarch)
           Requires: perl(Log::Dispatch)
Error: Package: mha4mysql-manager-0.58-0.el7.centos.noarch (/mha4mysql-manager-0.58-0.el7.centos.noarch)
           Requires: perl(Log::Dispatch::File)
Error: Package: mha4mysql-manager-0.58-0.el7.centos.noarch (/mha4mysql-manager-0.58-0.el7.centos.noarch)
           Requires: perl(Log::Dispatch::Screen)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Solution:
1. Download the latest epel-release rpm from
http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
2. Install epel-release rpm:
rpm -Uvh epel-release*rpm
3. Install perl-Log-Dispatch rpm package:
yum install mha4mysql-manager-0.58-0.el7.centos.noarch.rpm -y
This method uses all perl dependencies to report errors. :
1. Install
yum -y install mha4mysql-node-0.58-0.el7.centos.noarch.rpm
yum -y install mha4mysql-manager-0.58-0.el7.centos.noarch.rpm

Error 2:

[root@master mha4mysql]# masterha_check_ssh  --conf=/etc/mha4mysql/app1.cnf
Fri Mar 30 17:49:06 2018 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Fri Mar 30 17:49:06 2018 - [info] Reading application default configuration from /etc/mha4mysql/app1.cnf..
Parameter ping_interval must be positive integer! current value: 1         #设置监控主库,发送ping包的时间间隔,默认是3秒,尝试三次没有回应的时候自动进行railover
 at /usr/share/perl5/vendor_perl/MHA/SSHCheck.pm line 148.

Solution:
/etc/mha4mysql/app1.cnf file parameters cannot be followed by spaces

Error 3:

[root@master ~]# masterha_check_ssh  --conf=/etc/mha4mysql/app1.cnf
Fri Mar 30 18:28:28 2018 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Fri Mar 30 18:28:28 2018 - [info] Reading application default configuration from /etc/mha4mysql/app1.cnf..
Fri Mar 30 18:28:28 2018 - [info] Reading server configuration from /etc/mha4mysql/app1.cnf..
Fri Mar 30 18:28:28 2018 - [info] Starting SSH connection tests..
Fri Mar 30 18:28:28 2018 - [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln63]
Fri Mar 30 18:28:28 2018 - [debug]  Connecting via SSH from root@192.168.31.16(192.168.31.16:22) to root@192.168.31.118(192.168.31.118:22)..
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Fri Mar 30 18:28:28 2018 - [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln111] SSH connection from root@192.168.31.16(192.168.31.16:22) to root@192.168.31.118(192.168.31.118:22) failed!
Fri Mar 30 18:28:29 2018 - [debug]
Fri Mar 30 18:28:28 2018 - [debug]  Connecting via SSH from root@192.168.31.118(192.168.31.118:22) to root@192.168.31.16(192.168.31.16:22)..
Fri Mar 30 18:28:29 2018 - [debug]   ok.
Fri Mar 30 18:28:29 2018 - [debug]  Connecting via SSH from root@192.168.31.118(192.168.31.118:22) to root@192.168.31.2(192.168.31.2:22)..
Fri Mar 30 18:28:29 2018 - [debug]   ok.
Fri Mar 30 18:28:30 2018 - [debug]
Fri Mar 30 18:28:29 2018 - [debug]  Connecting via SSH from root@192.168.31.2(192.168.31.2:22) to root@192.168.31.16(192.168.31.16:22)..
Fri Mar 30 18:28:29 2018 - [debug]   ok.
Fri Mar 30 18:28:29 2018 - [debug]  Connecting via SSH from root@192.168.31.2(192.168.31.2:22) to root@192.168.31.118(192.168.31.118:22)..
Fri Mar 30 18:28:30 2018 - [debug]   ok.
SSH Configuration Check Failed!
 at /usr/bin/masterha_check_ssh line 44.
[root@master ~]# ssh master
root@master's password:
Permission denied, please try again.
root@master's password:
Permission denied, please try again.
root@master's password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
[root@master ~]#
[root@master ~]#
[root@master ~]# vim /etc/mha4mysql/app1.cnf
[root@master ~]# masterha_check_ssh  --conf=/etc/mha4mysql/app1.cnf
Fri Mar 30 18:41:21 2018 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Fri Mar 30 18:41:21 2018 - [info] Reading application default configuration from /etc/mha4mysql/app1.cnf..
Fri Mar 30 18:41:21 2018 - [info] Reading server configuration from /etc/mha4mysql/app1.cnf..
Fri Mar 30 18:41:21 2018 - [info] Starting SSH connection tests..
Fri Mar 30 18:41:22 2018 - [debug]
Fri Mar 30 18:41:21 2018 - [debug]  Connecting via SSH from root@192.168.31.118(192.168.31.118:22) to root@192.168.31.2(192.168.31.2:22)..
Fri Mar 30 18:41:22 2018 - [debug]   ok.
Fri Mar 30 18:41:22 2018 - [debug]
Fri Mar 30 18:41:22 2018 - [debug]  Connecting via SSH from root@192.168.31.2(192.168.31.2:22) to root@192.168.31.118(192.168.31.118:22)..
Fri Mar 30 18:41:22 2018 - [debug]   ok.
Fri Mar 30 18:41:22 2018 - [info] All SSH connection tests passed successfully.

Solution:
/etc/mha4mysql/app1.cnf
comment out the manager management node

Error 4:

[root@localhost ~]# masterha_check_repl --conf=/etc/app1.cnf
Sun Apr 22 20:29:30 2018 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun Apr 22 20:29:30 2018 - [info] Reading application default configuration from /etc/app1.cnf..
Sun Apr 22 20:29:30 2018 - [info] Reading server configuration from /etc/app1.cnf..
Sun Apr 22 20:29:30 2018 - [info] MHA::MasterMonitor version 0.58.
Sun Apr 22 20:29:32 2018 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln193] There is no alive slave. We can't do failover
Sun Apr 22 20:29:32 2018 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations.  at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 329.
Sun Apr 22 20:29:32 2018 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Sun Apr 22 20:29:32 2018 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

Solution:
(1). Delete the health check file rm -rf /var/log/masterha/app1/app1.master_status.health
(2). Resync to the master server in the downtime database change master to master_host...... ...
(3). Check for replication errors masterha_check_repl –conf=/etc/mysqlmha/conf/app1.cnf
or
(1). Check firewall

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324838535&siteId=291194637