心态炸裂,搭建mha时,在测试主从复制时候报错MySQL Replication Health is NOT OK!!!有点慌!慢慢盘吧!

Posted 龙少。

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了心态炸裂,搭建mha时,在测试主从复制时候报错MySQL Replication Health is NOT OK!!!有点慌!慢慢盘吧!相关的知识,希望对你有一定的参考价值。

MHA时测试主从复制报错mysql Replication Health is NOT OK!

具体报错信息

[root@manager bin]# masterha_check_repl -conf=/etc/masterha/app1.cnf
Sat Jul 31 05:23:03 2021 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sat Jul 31 05:23:03 2021 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Sat Jul 31 05:23:03 2021 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Sat Jul 31 05:23:03 2021 - [info] MHA::MasterMonitor version 0.57.
Sat Jul 31 05:23:04 2021 - [info] GTID failover mode = 0
Sat Jul 31 05:23:04 2021 - [info] Dead Servers:
Sat Jul 31 05:23:04 2021 - [info]   192.168.206.188(192.168.206.188:3306)
Sat Jul 31 05:23:04 2021 - [info] Alive Servers:
Sat Jul 31 05:23:04 2021 - [info]   192.168.206.88(192.168.206.88:3306)
Sat Jul 31 05:23:04 2021 - [info]   192.168.206.177(192.168.206.177:3306)
Sat Jul 31 05:23:04 2021 - [info] Alive Slaves:
Sat Jul 31 05:23:04 2021 - [info]   192.168.206.177(192.168.206.177:3306)  Version=5.7.20-log (oldest major version between slaves) log-bin:enabled
Sat Jul 31 05:23:04 2021 - [info]     Replicating from 192.168.206.88(192.168.206.88:3306)
Sat Jul 31 05:23:04 2021 - [info] Current Alive Master: 192.168.206.88(192.168.206.88:3306)
Sat Jul 31 05:23:04 2021 - [info] Checking slave configurations..
Sat Jul 31 05:23:04 2021 - [info]  read_only=1 is not set on slave 192.168.206.177(192.168.206.177:3306).
Sat Jul 31 05:23:04 2021 - [warning]  relay_log_purge=0 is not set on slave 192.168.206.177(192.168.206.177:3306).
Sat Jul 31 05:23:04 2021 - [info] Checking replication filtering settings..
Sat Jul 31 05:23:04 2021 - [info]  binlog_do_db= , binlog_ignore_db=
Sat Jul 31 05:23:04 2021 - [info]  Replication filtering check ok.
Sat Jul 31 05:23:04 2021 - [info] GTID (with auto-pos) is not supported
Sat Jul 31 05:23:04 2021 - [info] Starting SSH connection tests..
Sat Jul 31 05:23:15 2021 - [info] All SSH connection tests passed successfully.
Sat Jul 31 05:23:15 2021 - [info] Checking MHA Node version..
Sat Jul 31 05:23:15 2021 - [info]  Version check ok.
Sat Jul 31 05:23:15 2021 - [error][/usr/local/share/perl5/MHA/ServerManager.pm, ln492]  Server 192.168.206.188(192.168.206.188:3306) is dead, but must be alive! Check server settings.
Sat Jul 31 05:23:15 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations.  at /usr/local/share/perl5/MHA/MasterMonitor.pm line 402.
Sat Jul 31 05:23:15 2021 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Sat Jul 31 05:23:15 2021 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!


分析解决

1.主从复制做完后我是有做过数据库同步测试的,主从复制配置应该是没有问题的
2.然后到配置文件看是不是有问题

3.发现上面的配置文件路径应该是不对的,mysql安装时我选的路径是/usr/local/mysql/data,2个不匹配,重新修改再试试


依然还是not ok!

4.实在找不到还是什么原因,百度百度,说是从服务器上开启只读,查看已经配置过,应该不是这个问题

5.报错显示是188的服务器问题,查看服务正常,仔细检查后发现188的防火墙没关,心态又炸了


我以为这次肯定得好了吧,可是当我重新检查时还是not ok,有新的报错提示。好慌啊

报错显示应该是配置问题

mysqlbinlog version command failed with rc 1:0, please verify PATH, LD_LIBRARY_PATH, and client options

6.这个应该是变量的问题,应该是需要做软链接.,服务器重新做下软链接,服务器都做一下
ln -s /usr/local/mysql/bin/mysql /usr/sbin
ln -s /usr/local/mysql/bin/mysqlbinlog /usr/sbin

再检测还是not ok!哭了!报错又变了,说明还有其他的问题!


7.继续看报错

这个应该是字符集的问题,服务器配置文件里字符集注释一下

8.苍天啊大地啊,真的是历经磨难终于成功了,我要去睡觉了!

以上是关于心态炸裂,搭建mha时,在测试主从复制时候报错MySQL Replication Health is NOT OK!!!有点慌!慢慢盘吧!的主要内容,如果未能解决你的问题,请参考以下文章

MHA集群(gtid复制)和vip漂移

MySQL主从复制的简单搭建

MySQL主从复制的简单搭建

MySQL主从复制的简单搭建

Linux学习-MySQL的主从复制高可用性解决方案MHA

MySQL之 MHA 高可用集群部署