美文网首页
Mysql主从同步错误

Mysql主从同步错误

作者: e20d9310ced3 | 来源:发表于2017-12-01 10:13 被阅读0次

    Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 2 failed executing transaction 'ANONYMOUS' at master log mysql-bin.005656, end_log_pos 4529152. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.

    在从库中查看表performance_schema.replication_applier_status_by_worker
    select * from performance_schema.replication_applier_status_by_worker\G

    *************************** 2. row ***************************
    CHANNEL_NAME:
    WORKER_ID: 2
    THREAD_ID: NULL
    SERVICE_STATE: OFF
    LAST_SEEN_TRANSACTION: ANONYMOUS
    LAST_ERROR_NUMBER: 1168
    LAST_ERROR_MESSAGE: Worker 2 failed executing transaction 'ANONYMOUS' at master log mysql-bin.005656, end_log_pos 4529152; Error executing row event: 'Uerlying table which is differently defined or of non-MyISAM type or doesn't exist'
    LAST_ERROR_TIMESTAMP: 2017-12-01 08:57:55

    去主库查找binlog日志,看看发生了什么事情(日志定位方式有点挫)
    mysqlbinlog --start-position=4529152 --stop-position=4539152 mysql-bin.005656 | more
    这条命令是从4529152位置开始,但是我们出错的位置(end_log_pos)是这个位置结束,所以刚好错过,再往前一点就好 了。
    通过这条命令看到日志时间是2017-12-01 01:47:41,所以我用了另外一条命令
    mysqlbinlog --start-datetime=2017-12-01 01:47:41 --stop-datetime=2017-12-01 01:47:50 mysql-bin.005656 | more
    找到日志:


    image.png

    查看这个ID为332的这张表,发现这张表是自动创建的,创建的时候没有指定存储引擎,所以主从都出错了

    相关文章

      网友评论

          本文标题:Mysql主从同步错误

          本文链接:https://www.haomeiwen.com/subject/mysibxtx.html