文章目录
- 前言
- 一:报错与解决
-
-
- 1.1:报错: [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln364] None of slaves can be master. Check failover configuration file or log-bin settings in my.cnf
- 1.2:报错: User myslave does not exist or does not have REPLICATION SLAVE privilege! Other slaves can not start replication from this host.
- 1.3:报错:[/usr/local/share/perl5/MHA/MasterMonitor.pm, ln208] Slaves settings check failed!
- 1.4:报错:[error]/usr/local/share/perl5/MHA/MasterMonitor.pm, ln208 Slaves settings check failed!
- 1.5:报错:Testing mysql connection and privileges..sh: mysql: 未找到命令
- 1.6:报错:Failed to get master_ip_failover_script status with return code 2:0.
-
前言
一:报错与解决
1.1:报错: [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln364] None of slaves can be master. Check failover configuration file or log-bin settings in my.cnf
-
报错描述
[root@mha_manager ~]# masterha_check_repl -conf=/etc/masterha/app1.cnf ...省略内容 Fri Jan 10 08:42:12 2020 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln364] None of slaves can be master. Check failover configuration file or log-bin settings in my.cnf Fri Jan 10 08:42:12 2020 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/local/bin/masterha_check_repl line 48. Fri Jan 10 08:42:12 2020 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers. Fri Jan 10 08:42:12 2020 - [info] Got exit code 1 (Not master dead). MySQL Replication Health is NOT OK!
-
原因:
mysql集群中的slave节点中数据库配置文件/etc/my.cnf中没有配置二进制日志,只需要在所有slave节点配置二进制日志即可
二进制日志格式 log-bin=xxx(名称自定义)
-
解决:在所有slave节点配置二进制日志
[root@slave1 ~]# vim /etc/my.cnf [mysqld]段落添加 log-bin=slave1-bin '//添加二进制日志' 所以slave节点都要配置,我就不一一展示了
1.2:报错: User myslave does not exist or does not have REPLICATION SLAVE privilege! Other slaves can not start replication from this host.
-
报错描述
[root@mha_manager ~]# masterha_check_repl -conf=/etc/masterha/app1.cnf ...省略内容 Fri Jan 10 09:04:53 2020 - [error][/usr/local/share/perl5/MHA/Server.pm, ln398] 192.168.79.135(192.168.79.135:3306): User myslave does not exist or does not have REPLICATION SLAVE privilege! Other slaves can not start replication from this host. Fri Jan 10 09:04:53 2020 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/local/share/perl5/MHA/ServerManager.pm line 1403. Fri Jan 10 09:04