从机的slave_sql_running线程关闭,很多天之后才被发现,日志文件我设定的过期时间是1天,丛机的sql_running线程停掉之后中继日志不会被删除,然后我重新开启从机,
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.
报这个错误,复制的时候主机的bin-log也一定要?不是丛机有中继日志吗,中继日志不是已经把主机的bin-log已经复制过来了吗?为什么还需要主机的日志 呢?
用mysqlbinlog 打开了出错的relay_log,发现已经损坏,想跳过这个日志 
change master to RELAY_LOG_FILE='dream-europe-s1-relay-bin.002124',relay_log_pos=0;
结果还是报错
这是什么情况
Error Code : 1380
Failed initializing relay log position: Could not find target log during relay log initialization
(0 ms taken)
高手赐教!!!不胜感激!!

解决方案 »

  1.   

    从机的slave_sql_running线程关闭 原因是什么如果是IO线程断掉  则需要重新拉master库上的binlog
    如果是sql线程断掉  则不需要重新拉binlog
      

  2.   

    你这种情况保险点最好重新mysqldump主库  重新做个从库
      

  3.   

    另外即使加nagios监控报警 以防数据库down掉都不知道
      

  4.   

    是sql线程关闭了,就是在执行relay_log_file的时候
    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.我想跳过这个中继文件直接执行下一个文件
    change master to RELAY_LOG_FILE='dream-europe-s1-relay-bin.002124',relay_log_pos=0;
    使用这条命令。
    以下是打开出问题的中继文件的报错信息
    D:\MySQL Server 5.1_3307\data>mysqlbinlog dream-europe-s1-relay-bin.002122>1.txtERROR: Error in Log_event::read_log_event(): 'read error', data_len: 283137, eve
    nt_type: 2
    ERROR: Could not read entry at offset 94710660: Error in log format or read erro
    r.
      

  5.   

    如果你的从库故障后没有其他的写操作,记录下Master_Log_File与Exec_Master_Log_Pos,change slave to ... 从这个位置重新开启主从
      

  6.   


    主机的日志文件只剩下一天之内的日志,从机已经停了七天了,如果change master to master_log_file那就只能从最近一天的位置开始复制,数据丢失很多。现在就是中继日志还没有被删除,而其中有一个已经损坏,执行不下去,我想用change跳过,结果报错,语句应该没错吧
    change master to RELAY_LOG_FILE='dream-europe-s1-relay-bin.002124',relay_log_pos=0;
    使用这条命令。
    以下是打开出问题的中继文件的报错信息
    D:\MySQL Server 5.1_3307\data>mysqlbinlog dream-europe-s1-relay-bin.002122>1.txtERROR: Error in Log_event::read_log_event(): 'read error', data_len: 283137, eve
    nt_type: 2
    ERROR: Could not read entry at offset 94710660: Error in log format or read erro
      

  7.   

    试下手动使用relay-log恢复后,如果不行,只能是重新全库dump了,binlog最好还是保留时间长一定,出了问题也好恢复