mysql master - slave 同步出错,slave 报如下错:110310 21:08:22 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
110310 21:08:22 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'db77.000143' position 366306998
110310 21:08:22 [ERROR] Error in Log_event::read_log_event(): 'Event too big', data_len: 808474952, event_type: 120110310 21:08:22 [ERROR] Error reading relay log event: slave SQL thread aborted because of I/O error110310 21:08:22 [ERROR] Slave: 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: 0110310 21:08:22 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'db77.000143' position 297   110310 21:08:22 [Note] Slave: connected to master '---------'标注了,replication resumed in log 'db77.000143' at position 366306998检查后发现是relay log is corrupted,请教在下面四句的提示下
问题a:我change master to MASTER_LOG_FILE='db77.000143' , MASTER_LOG_POS=???
问题b:还有,'Event too big', data_len: 808474952 这个也太大了吧。是max_allowed_packet的影响吗?我已经将其设置很大了,盼回1、Failed reading log event,reconnecting to retry, log 'db77.000143' position 366306998
2、We stopped at log 'db77.000143' position 297   
3、replication resumed in log 'db77.000143' at position 366306998
4、show slave status \G;提示的二句
    Relay_Log_Pos: 366307104                
    Relay_Master_Log_File: db77.000143
    Exec_Master_Log_Pos: 297
    Relay_Log_Space: 675674054

解决方案 »

  1.   

    the master's binary log is corrupted重新制定log 以跳过出错的那些日志,可能会引起数据不一致
    change master to  MASTER_LOG_FILE = 'master_log_name'
        , MASTER_LOG_POS =master_log_pos
      

  2.   

    从日志 开始执行 db77.000143 在my.cnf忽悠掉主键重复错误。
    然后跳过db77.000143的时候 stop slave,不忽悠主键重复错误。