Slave failed to initialize relay log info structure from the repository

原创 2015年07月09日 08:54:18
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_Running: No
Slave_SQL_Running: No
Last_SQL_Errno: 1872
Last_SQL_Error: Slave failed to initialize relay log info structure from the repository
               
               
MySQL的错误日志:error_slave.log               
[Note] Slave: MTS group recovery relay log info based on Worker-Id 0, group_relay_log_name /data_3308/logs/relay_3308.000845, group_relay_log_pos 522379324 group_master_log_name mysql_bin_3308.000011, group_master_log_pos 1000899622
[Note] Slave: MTS group recovery relay log info group_master_log_name mysql_bin_3308.000011, event_master_log_pos 1000892908.
[Note] Slave: MTS group recovery relay log info group_master_log_name mysql_bin_3308.000011, event_master_log_pos 1000894934.
[Note] Slave: MTS group recovery relay log info group_master_log_name mysql_bin_3308.000011, event_master_log_pos 1000897596.
[Note] Slave: MTS group recovery relay log info group_master_log_name mysql_bin_3308.000011, event_master_log_pos 1000899622.
[Note] Slave: MTS group recovery relay log info based on Worker-Id 1, group_relay_log_name /data_3308/logs/relay_3308.000845, group_relay_log_pos 522377298 group_master_log_name mysql_bin_3308.000011, group_master_log_pos 1000897596
[Note] Slave: MTS group recovery relay log info group_master_log_name mysql_bin_3308.000011, event_master_log_pos 1000892908.
[Note] Slave: MTS group recovery relay log info group_master_log_name mysql_bin_3308.000011, event_master_log_pos 1000894934.
[Note] Slave: MTS group recovery relay log info group_master_log_name mysql_bin_3308.000011, event_master_log_pos 1000897596.
[ERROR] --relay-log-recovery cannot be executed when the slave was stopped with an error or killed in MTS mode;
consider using RESET SLAVE or restart the server with --relay-log-recovery = 0
followed by START SLAVE UNTIL SQL_AFTER_MTS_GAPS
[ERROR] Failed to initialize the master info structure
[Note] Check error log for additional messages. You will not be able to start replication until the issue is resolved and the server restarted.



relay_log_recovery 和slave_parallel_workers的参数设置 
mysql> show variables  where variable_name  in ('slave_parallel_workers','relay_log_recovery');
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| relay_log_recovery     | ON    |
| slave_parallel_workers | 2     |
+------------------------+-------+
2 rows in set (0.03 sec)


my.cnf修改relay_log_recovery=0, 重启MySQL, start slave 恢复正常。 




关于此错误的分析:

http://www.hustdba.com/?p=74



http://bugs.mysql.com/bug.php?id=72824 中给出的方法
reset slave all won't work, in my instance, I use the following method:
1) keep record of the info in Relay log info;(show slave status)
2) stop slave;
3) reset slave;
4) start slave; 
5) stop slave;
6) change master to position recorded in step 1);

7) start slave

Description:
With slave_parallel_workers > 0 if the slave is restarted while the replication is stopped due to an error, it is not possible to get the replication running again.
Confirmed in 5.6.19 and 5.7.4.

是不是意味着MySQL在5.6.19 and 5.7.4 版本之间,如果slave_parallel_workers > 0同时relay_log_recovery设置为ON的话会有问题呢?
relay_log_recovery=ON
slave_parallel_workers=2


5.6的官方文档对relay-log-recovery的描述
http://dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#option_mysqld_relay-log-recovery
Prior to MySQL 5.6.6, if this option is enabled for a multi-threaded slave, and the slave fails with errors,
 you cannot execute CHANGE MASTER TO on that slave. In MySQL 5.6.6 or later, 
 you can use START SLAVE UNTIL SQL_AFTER_MTS_GAPS to ensure that any gaps in the relay log are processed;
after running this statement, you can then use CHANGE MASTER TO to fail this slave over to a new master. (Bug #13893363)

Slave failed to initialize relay log info structure from the repository, Error_code: 1872

在一台主机上增加一个slave,启动的时候报 [ERROR] Slave SQL: Slave failed to initialize relay log info structure from ...
  • lwei_998
  • lwei_998
  • 2014年11月17日 16:01
  • 17449

mysql错误解决总结

1、 MySQL错误日志里出现: 140331 10:08:18 [ERROR] Error reading master configuration 140331 10:08:18...
  • u010098331
  • u010098331
  • 2016年03月10日 09:49
  • 9606

mmm 主从复制机制排错过程

一. 主机器发出一个sql,导致所有的从机同步出错的问题解决流程a.)进入从机的mysql控制台b.) 查看复制进程的信息mysql> show slave status\Gc.) 关注以下3个key...
  • remote_roamer
  • remote_roamer
  • 2016年07月19日 14:49
  • 1812

mysql 从库I/O及SQL thread 状态解释

8.14.6 Replication Slave I/O Thread States The following list shows the most common states you se...
  • shaochenshuo
  • shaochenshuo
  • 2015年11月03日 09:28
  • 1902

mysql 清除relay-log文件方法详解

mysql 清除relay-log文件方法详解 今天在本机的mysql数据目录下发现了许多类似hostname-relay-bin.0000*的文件,该文件一般是在mysql slave实例上存...
  • u010098331
  • u010098331
  • 2016年02月24日 13:00
  • 6584

mysql relay_log_recovery relay_log_info_repository

relay-log-info记录SQL线程读取Master binlog的位置,用于Slave 宕机后根据文件中记录的pos点恢复Sql线程master-info 记录IO线程读取已经读取到的mast...
  • Maikilee_sys
  • Maikilee_sys
  • 2016年09月13日 17:05
  • 370

LoadRunner11回放脚本出现“Vuser failed to initialize extension LrXml.dll”提示的解决方法

  • 2012年12月08日 16:43
  • 84KB
  • 下载

关于mac上运行kinect后出现Target VM failed to initialize的解决办法

  • 2015年06月08日 11:31
  • 391KB
  • 下载

Error reading relay log event: slave SQL thread was killed

1.版本 1)操作系统  cat /etc/issue Red Hat Enterprise Linux Server release 5.5 (Tikanga) Kernel \r on an ...
  • shaochenshuo
  • shaochenshuo
  • 2015年12月15日 13:59
  • 2889

clone failed. Could not read from remote repository 解决方案

最近在github上clone项目的遇到 "clone failed. Could not read from remote repository". 这个问题。 在百度,google之后仍然没...
  • backin7451369
  • backin7451369
  • 2017年05月27日 11:39
  • 806
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Slave failed to initialize relay log info structure from the repository
举报原因:
原因补充:

(最多只允许输入30个字)