Slave IO thread is not running on问题的解决
搭建MHA最少需要3台MySQL服务器,一主两从,一从做slave,一从兼职做manager
基本环境做好
(mysql安装(同一版本)
防火墙、selinux永久关闭
配置好/etc/hosts
xtrabackup工具安装)
今天我在搭建中,不小心在主库也执行了start slave,结果在manager上执行
[root@rhel3 ~]# masterha_check_repl --conf=/etc/masterha/app1.cnf命令时出现错误,复制环境检查不成功
172.16.8.12 (current master)
+--172.16.8.12
+--172.16.8.13
+--172.16.8.11
Sun Jun 23 17:45:58 2019 - [info] Checking replication health on 172.16.8.12..
Sun Jun 23 17:45:58 2019 - [error][/usr/share/perl5/vendor_perl/MHA/Server.pm, ln472] Slave IO thread is not running on 172.16.8.12(172.16.8.12:3306)
Sun Jun 23 17:45:58 2019 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln1429] failed!
Sun Jun 23 17:45:58 2019 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln386] Error happend on checking configurations. at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 379
Sun Jun 23 17:45:58 2019 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln482] Error happened on monitoring servers.
Sun Jun 23 17:45:58 2019 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
如上,主库是8.12,从库中也有8.12,报的错如上,从IO线程不在172.16.8.12(172.16.8.12:3306)上运行,
找到问题就好解决,
在主库上执行
mysql> reset slave all; Query OK, 0 rows affected (0.02 sec)
再在manager上执行命令,复制环境检查成功
masterha_check_repl --conf=/etc/mha/app1.cnf
Thu Jun 3 05:30:40 2021 - [info] Checking replication health on 192.168.119.162..
Thu Jun 3 05:30:40 2021 - [info] ok.
Thu Jun 3 05:30:40 2021 - [info] Checking replication health on 192.168.119.163..
Thu Jun 3 05:30:40 2021 - [info] ok.
Thu Jun 3 05:30:40 2021 - [warning] master_ip_failover_script is not defined.
Thu Jun 3 05:30:40 2021 - [warning] shutdown_script is not defined.
Thu Jun 3 05:30:40 2021 - [info] Got exit code 0 (Not master dead).
MySQL Replication Health is OK.
现在我们的星球特价优惠,仅售79元!领取优惠券,69即可加入,但是,请注意,此优惠将在5月31日结束,一旦优惠结束,价格将调整为119元,目前是最低价。目前发布了10个专栏、100+内容。
本星球包含了海量运维、安全、设计微服务k8s、Python干货分享、提供最完整的指引,帮助你轻松掌握ChatGPT理论和实战应用场景、如何变现、如何正确使用AI!!时代赋予的机遇,你可躺平,但生活从不手软,你赚的每一分钱都是成长的变现!!赶紧抓住这个巨大的风口红利,建议跟着这个课程来学习,相信能带你成为ChatGPT大师!