mysql主从复制出现connecting的其它情况

今天在配置mysql的主从复制时,出现了Slave_IO_RunningConnecting的情况,如下图所示

使用统一新下载的mariadb和vagrant 1.9+版本配置

一般情况下分析应该是这三个方面:
网络不通
config不对
语句出错

可是在用vagrant管理的虚拟机节点上是可以正常上网的,可以下载安装mariadb,而且后两个问题应该也不是我遇到的,因为已经配置了好多遍。后来在逛论坛时,有人说了一句“windows系统的vagrant如果是1.9+版本,分配ip时是有BUG的

这时候我才想起应该要先主从服务器ping一下对方,或者至少先查看一下ip地址,果然,在ifconfig之后看到

这里写图片描述

这里并没有出现我之前给它配置的192.168.33.102的ip地址,于是想到重启一下网络服务器试试

这里写图片描述

接着再执行ifconfig,发现自己配置的ip地址回来了

这里写图片描述

接着就又开始重启mariadb服务器,然后重新配置,最后解决了

这里写图片描述

配置
主机Windows
vagrant版本1.9.1
虚拟机centos 7
firewalld已关闭[sudo systemctl stop firewalld.service]
SELinux默认关闭[getenforce -> disabled]
iptables并无安装配置iptables

希望可以给那些使用vagrant 1.9+的朋友一点帮助

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Master configuration Find the my.cnf file Configure under [mysqld] [mysqld] server-id=1 log-bin=master-bin   Restart the service and log in to mysql Create a user to obtain the log file. mysql> CREATE USER 'sree'@'%' IDENTIFIED BY 'sree' Grant relevant permissions (copy permissions) *.* represents all tables in all libraries mysql> grant replication slave on *.* to 'sree'@'%'   Refresh permissions mysql> flush privileges mysql> show master status; | File | Position | master-bin.000004 | 120                      Slave configuration ==================== Modify the configuration file: Configure under [mysqld] [mysqld] server-id=2 #As long as it is different from the above.   Then log in to mysql mysql>  CHANGE MASTER TO     MASTER_LOG_FILE='master-bin.000004 ', #above file        MASTER_LOG_POS = 120 ; #The above position        MASTER_HOST='192.168.249.130', #The ip address of the main library         MASTER_USER = 'sree',         MASTER_PASSWORD = 'sree',  Then start slave ============ mysql> show slave status\G; see: ===  Slave_IO_Running: Yes  Slave_SQL_Running: Yes It means that it was successful.     Errors in the whole process: Slave_IO_Running: Connecting 1. Mine is the wrong host ip. 2. There are still some firewalls on the Internet that are not turned off I use centos7 to turn off the firewall: systemctl stop firewalld 3. There is also a mistake in the above-mentioned secret.   Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs This error generally occur when we clone the master to slaver. Delete auto.cnf of mysql, and then restart the service.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

newcih

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值