jianwu5 发表于 2016-07-24 22:52

奇怪的二进制复制错误

我使用主-分发-从的结构模拟mysql复制;分发库使用blackhole引擎,实际是不贮存任何数据,只作收发复制日志。
主库为centos虚拟主机,分发库为windows 7 64bit ,从库是centos实体机。
mysql版本分别为 主mysql7.12 分发7.13 从库 7.13
实际是,我有另外二部电脑,相同的配置,版本一致,没出现问题。

接着,配置完毕,从分发库至从库的IO与SQL线程是正常的,但从主库到分发库的复制则出现了错误,报错如下:
2016-07-24T14:28:19.810200Z 16 Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000002' at position 154, relay log '.\N4EVFLR2X6U1.replicate' position: 4
2016-07-24T14:28:19.837202Z 15 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
2016-07-24T14:28:19.922207Z 16 next log error: -1offset: 28log: .\N4EVFLR2X6U1.replicate included: 1
2016-07-24T14:28:19.924207Z 16 Error reading relay log event for channel '': Error purging processed logs
2016-07-24T14:28:19.925207Z 16 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
2016-07-24T14:28:19.930207Z 16 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 154google了下,第三个最长的错误是最常见的,主要是复制的pos由于各种原因出现了偏差,重新校正就行了,但我认真对比主、从的复制文件与位置几十遍都不凑效。
困难的是net log error与Error reading relay log...两条错误,几乎google不到。
无论我把主机reset master,从机reset slave重新开始复制都是出现同样的错误,都是IO线程正常,而进行复制的SQL因为错误无法启动。
从理论上来说应该是复制过来的语句无法执行,但通过把mysqlbinlog导出复制语句在分发库上实际执行,无法看到语句有问题。
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
受影响的行: 0
时间: 0.001s


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



# at 4
#160724 18:33:11 server id 104end_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 104end_log_pos 154 CRC32 0xe26e4262         Previous-GTIDs
#
# at 154
#160724 18:34:22 server id 104end_log_pos 210 CRC32 0xa505b2a4         Rotate to N4EVFLR2X6U1.replicatepos: 4
# at 210
#160724 18:34:22 server id 104end_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 104end_log_pos 360 CRC32 0x27113558         Previous-GTIDs
#
# at 360
#7001018:00:00 server id 10end_log_pos 0 CRC32 0x5bce41ed         Rotate to mysql-bin.000002pos: 154
# at 407
#160724 16:00:58 server id 10end_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


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



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


/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
受影响的行: 0
时间: 0.001s
这是什么原因?

另外,如果我在分发库上执行二次start slave;SQL线程是可以启动的,但这样做是非正常启动吧?!
页: [1]
查看完整版本: 奇怪的二进制复制错误