免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1451 | 回复: 0
打印 上一主题 下一主题

奇怪的二进制复制错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2016-07-24 22:52 |只看该作者 |倒序浏览
我使用主-分发-从的结构模拟mysql复制;分发库使用blackhole引擎,实际是不贮存任何数据,只作收发复制日志。
主库为centos虚拟主机,分发库为windows 7 64bit ,从库是centos实体机。
mysql版本分别为 主mysql7.12 分发7.13 从库 7.13
实际是,我有另外二部电脑,相同的配置,版本一致,没出现问题。

接着,配置完毕,从分发库至从库的IO与SQL线程是正常的,但从主库到分发库的复制则出现了错误,报错如下:

  1. 2016-07-24T14:28:19.810200Z 16 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000002' at position 154, relay log '.\N4EVFLR2X6U1.replicate' position: 4
  2. 2016-07-24T14:28:19.837202Z 15 [Note] Slave I/O thread for channel '': connected to master 'reslave@192.168.1.112:3306',replication started in log 'mysql-bin.000002' at position 154
  3. 2016-07-24T14:28:19.922207Z 16 [ERROR] next log error: -1  offset: 28  log: .\N4EVFLR2X6U1.replicate included: 1
  4. 2016-07-24T14:28:19.924207Z 16 [ERROR] Error reading relay log event for channel '': Error purging processed logs
  5. 2016-07-24T14:28:19.925207Z 16 [ERROR] Slave SQL for channel '': Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 1594
  6. 2016-07-24T14:28:19.930207Z 16 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000002' position 154
复制代码
google了下,第三个最长的错误是最常见的,主要是复制的pos由于各种原因出现了偏差,重新校正就行了,但我认真对比主、从的复制文件与位置几十遍都不凑效。
困难的是net log error与Error reading relay log...两条错误,几乎google不到。
无论我把主机reset master,从机reset slave重新开始复制都是出现同样的错误,都是IO线程正常,而进行复制的SQL因为错误无法启动。
从理论上来说应该是复制过来的语句无法执行,但通过把mysqlbinlog导出复制语句在分发库上实际执行,无法看到语句有问题。
[SQL]/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
受影响的行: 0
时间: 0.001s

[SQL]
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
受影响的行: 0
时间: 0.001s

[SQL]

# at 4
#160724 18:33:11 server id 104  end_log_pos 123 CRC32 0xda3ae9db         Start: binlog v 4, server v 5.7.13-log created 160724 18:33:11 at startup
# This Format_description_event appears in a relay log and was generated by the slave thread.
# at 123
#160724 18:33:11 server id 104  end_log_pos 154 CRC32 0xe26e4262         Previous-GTIDs
# [empty]
# at 154
#160724 18:34:22 server id 104  end_log_pos 210 CRC32 0xa505b2a4         Rotate to N4EVFLR2X6U1.replicate  pos: 4
# at 210
#160724 18:34:22 server id 104  end_log_pos 329 CRC32 0x7d993545         Start: binlog v 4, server v 5.7.13-log created 160724 18:34:22
# This Format_description_event appears in a relay log and was generated by the slave thread.
# at 329
#160724 18:34:22 server id 104  end_log_pos 360 CRC32 0x27113558         Previous-GTIDs
# [empty]
# at 360
#700101  8:00:00 server id 10  end_log_pos 0 CRC32 0x5bce41ed         Rotate to mysql-bin.000002  pos: 154
# at 407
#160724 16:00:58 server id 10  end_log_pos 0 CRC32 0xda5a7a82         Start: binlog v 4, server v 5.7.12-log created 160724 16:00:58
BINLOG '
unWUVw8KAAAAdwAAAAAAAAAAAAQANS43LjEyLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
AYJ6Wto=
';
受影响的行: 0
时间: 0.000s

[SQL]
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ ;
受影响的行: 0
时间: 0.001s

[SQL]

# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
受影响的行: 0
时间: 0.001s

[SQL]
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
受影响的行: 0
时间: 0.001s

这是什么原因?

另外,如果我在分发库上执行二次start slave;SQL线程是可以启动的,但这样做是非正常启动吧?!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP