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
  • 16267

mysql 从库变更实例目录及端口

mysql有时候需要做一些目录,主机名,ip,以及端口的调整,那是不是直接进行数据目录变更或者参数变更呢? 本文将讲解关于端口变更(包含目录变更)后如何正常启动数据库继续服务。 背景: 主库使用的...
  • wlzjsj
  • wlzjsj
  • 2016年08月23日 13:09
  • 649

mysql5.6数据库同步,单向双向同步问题

windows下MySQL5.6实现主从数据库同步数据 mysql5.6数据库同步,单向双向同步问题...

Mysql-error code汇总

OS error code 1: Operation not permitted OS error code 2: No such file or directory OS err...

MYSQL— perror 错误码详情

[root@localhost ~]# cat test_nothread.py import paramiko import threading import os def ssh2(ip,use...

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
  • 16267

yii2教程-登录与自动登录机制解析

简介 yii2的自动登录的原理很简单。主要就是利用cookie来实现的,在第一次登录的时候,如果登录成功并且选中了下次自动登录,那么就会把用户的认证信息保存到cookie中,cookie的有...

mysql relay_log_recovery relay_log_info_repository

relay-log-info记录SQL线程读取Master binlog的位置,用于Slave 宕机后根据文件中记录的pos点恢复Sql线程master-info 记录IO线程读取已经读取到的mast...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Slave failed to initialize relay log info structure from the repository
举报原因:
原因补充:

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