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上执行命令,复制环境检查成功

172.16.8.12 (current master)
 +--172.16.8.13
 +--172.16.8.11

Sun Jun 23 17:46:38 2019 - [info] Checking replication health on 172.16.8.13..
Sun Jun 23 17:46:38 2019 - [info]  ok.
Sun Jun 23 17:46:38 2019 - [info] Checking replication health on 172.16.8.11..
Sun Jun 23 17:46:38 2019 - [info]  ok.
Sun Jun 23 17:46:38 2019 - [info] Checking master_ip_failover_script status:
Sun Jun 23 17:46:38 2019 - [info]   /usr/bin/master_ip_failover --command=status --ssh_user=root --orig_master_host=172.16.8.12 --orig_master_ip=172.16.8.12 --orig_master_port=3306 
Checking the Status of the script.. OK 
Sun Jun 23 17:46:38 2019 - [info]  OK.
Sun Jun 23 17:46:38 2019 - [warning] shutdown_script is not defined.
Sun Jun 23 17:46:38 2019 - [info] Got exit code 0 (Not master dead).

MySQL Replication Health is OK.
  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
The error message "The slave I/O thread is not running" indicates that the slave database server is not able to connect or synchronize with the master database server in a MySQL replication setup. Here are a few steps you can follow to troubleshoot and resolve this issue: 1. Check the connection settings: Verify that the slave database server has the correct configuration settings for connecting to the master database server. This includes the `master_host`, `master_user`, `master_password`, and `master_port` variables in the slave's MySQL configuration file (`my.cnf` or `my.ini`). 2. Verify network connectivity: Ensure that the slave database server can reach the master database server over the network. Check for any firewall rules or network restrictions that may be blocking the connection. 3. Check replication user permissions: Ensure that the replication user on the master database server has the necessary permissions to replicate data to the slave. The user should have the `REPLICATION SLAVE` privilege granted. 4. Check replication status: Use the following command on the slave database server to check the replication status: ``` SHOW SLAVE STATUS; ``` Look for any errors or warnings in the output, such as a failed connection or replication lag. Pay attention to fields like `Slave_IO_Running` and `Last_IO_Error` to identify potential issues. 5. Restart replication: If you have made any changes to the configuration or encountered errors, you can try restarting the replication process on the slave database server. Use the following commands: ``` STOP SLAVE; START SLAVE; ``` 6. Monitor logs: Check the MySQL error log file on both the master and slave database servers for any relevant error messages or warnings that might shed light on the issue. The log files are typically located at `/var/log/mysql/error.log` or `/var/log/mysqld.log`. If you are still unable to resolve the issue, it may be helpful to consult the MySQL documentation or seek assistance from the MySQL community or database administrators with expertise in MySQL replication.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值