今天在部署mysql主从复制时遇到个小问题

在配置完所有步骤后,想在主库插入数据测试从库又没复制

结果发现从库没有反应。

这时查了一下从库的状态,如下:

root@localhost:mysql.sock  04:43:35 [lala]>show slave status\G

*************************** 1. row ***************************

Slave_IO_State:

Master_Host: 192.168.161.128

Master_User: repl

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mybinlog.000004

Read_Master_Log_Pos: 331

Relay_Log_File: mysql-relay-bin.000001

Relay_Log_Pos: 4

Relay_Master_Log_File: mybinlog.000004

Slave_IO_Running: No

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 0

Last_Error:

Skip_Counter: 0

Exec_Master_Log_Pos: 331

Relay_Log_Space: 120

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: NULL

Master_SSL_Verify_Server_Cert: No

Last_IO_Errno: 1593

Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.

Last_SQL_Errno: 0

Last_SQL_Error:

Replicate_Ignore_Server_Ids:

Master_Server_Id: 203306

Master_UUID:

Master_Info_File: /data/mysql/mytest_3306/data/master.info

SQL_Delay: 0

SQL_Remaining_Delay: NULL

Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it

Master_Retry_Count: 86400

Master_Bind:

Last_IO_Error_Timestamp: 161207 04:40:45

Last_SQL_Error_Timestamp:

Master_SSL_Crl:

Master_SSL_Crlpath:

Retrieved_Gtid_Set:

Executed_Gtid_Set:

Auto_Position: 0

1 row in set (0.00 sec)

从我标粗体部分的信息可以清楚地看到Slave_IO_Running参数为no,这说明Slave_IO_thread没有起来

错误原因也给出了Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.

master和slave有同一个UUIDs导致线程停止,该线程需要将两个线程改成不一样才能工作。

这时查一下两个库的UUIDs

root@localhost:mysql.sock  06:13:40 [(none)]>show variables like '%UUID%'

-> ;

+---------------+--------------------------------------+

| Variable_name | Value                                |

+---------------+--------------------------------------+

| server_uuid   | af3609-b426-11e6-9ff3-000c29d55626 |

+---------------+--------------------------------------+

1 row in set (0.00 sec)

发现都是af3609-b426-11e6-9ff3-000c29d55626

这时修改删除slave库中的auto.cnf文件即可,该文件就在mysql的datadir下

因为UUID参数读的就是该文件下的内容,删除后,mysql会重新生成新的uuid。或者不删除直接改变该文件的几个数字。

删除完后重启mysql服务器,再开启主从复制,发现状态正常了

ps:两个auto.cnf一样的原因是因为我的从库是直接拷贝主库,所以auto.cnf自然相同了!!!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31386161/viewspace-2129967/,如需转载,请注明出处,否则将追究法律责任。

MySQL双主io线程起不来_解决master and slave have equal MySQL server UUIDs导致Slave_IO_thread起不来问题...相关推荐

  1. 搭建Mysql双主双从报错The slave I/O thread stops because master and slave have equal MySQL server UUIDs(已解决)

    搭建Mysql双主双从报错The slave I/O thread stops because master and slave have equal MySQL server UUIDs 具体问题 ...

  2. mysql主从同步错误:The slave I/O thread stops because master and slave have equal MySQL server UUIDs

    在配置mysql主从复制的时候出现错误: Fatal error: The slave I/O thread stops because master and slave have equal MyS ...

  3. mysql主从同步报错Fatal error: The slave I/O thread stops because master and slave have equal MySQL server

    问题:在mysql主从同步的过程中检查主从同步状态时IO线程报错 Last_IO_Error: Fatal error: The slave I/O thread stops because mast ...

  4. The slave I/O thread stops because master and slave have equal MySQL server UUIDs;

    最近在部署MySQL主从复制架构的时候,碰到了"Last_IO_Error: Fatal error: The slave I/O thread stops because master a ...

  5. The slave I/O thread stops because master and slave have equal MySQL server UUID

    The slave I/O thread stops because master and slave have equal MySQL server UUIDs The slave I/O thre ...

  6. Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs

    show slave status\G 发现有下面报错,导致复制起不来 - Relay_Master_Log_File: Slave_IO_Running: No Slave_SQL_Running: ...

  7. 主从复制报错Fatal error:The slave I/O thread stops because master and slave have equal MySQL server UUIDs;

    异常 在MySQL中开启主从复制失败: 原因 先确定主机和从机的server-id是否不一样,如果一样也会导致主从复制失败.主机和从机的server-id在/etc/my.cnf配置文件中配置的,下面 ...

  8. 搭建mysql 主从复制The slave I/O thread stops because master and slave have equal MySQL server UUIDs

    mysql 搭建主从复制 报错: Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave hav ...

  9. Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL ser

    配置mysql主从模式完毕后 show slave status\G; 查看slave配置中出错: Slave_IO_Running: No Last_IO_Error: Fatal error: T ...

最新文章

  1. 干货 | 5个常用的深度学习框架
  2. 雷林鹏分享:C# 运算符
  3. 工作173:一级控制二级菜单的变化
  4. python--文件
  5. selenium上传文件方法
  6. qwtplot读取tid数据并绘图
  7. petshop4.0 详解之七(PetShop表示层设计)
  8. C-Lodop的https扩展版,火狐下添加例外
  9. ssh登录到esxi机器中后开关虚拟机
  10. Java反射及 IoC原理、内省机制
  11. Python仿微信红包算法
  12. 房屋建筑与装饰工程工程量计算新旧规范对比(二)
  13. font-family 字体及各大主流网站对比
  14. 证明:T(n)= T(n-1) + O(n)等于O(n的平方)
  15. 干货丨让你更容易影响别人的 52 个小技巧
  16. 记一次疑难杂症-HTTP请求RST
  17. 连续仨月霸占牛客榜首,京东T8呕心巨作:700页JVM虚拟机实战手册
  18. 一个屌丝程序猿的人生(五十八)
  19. 范祖红金融消费者权益保护及投诉处理专家
  20. IDEA自动导包功能

热门文章

  1. 缓冲区溢出漏洞攻击——Shellcode编写
  2. EXE与SYS通信(其他模式)
  3. (六)boost库之内存管理shared_ptr
  4. 对现有的所能找到的DDOS代码(攻击模块)做出一次分析----UDP篇
  5. MFC Radio Button 使用 分组 RadioButton 用法
  6. Python 让所有奇数都在偶数前面,而且奇数升序排列,偶数降序排序
  7. MySQL(四)索引的使用
  8. Redis性能指标监控
  9. OS- -请求分页系统、请求分段系统和请求段页式系统(二)
  10. 青蛙跳台(含变种)及汉诺塔递归,母牛生小牛