ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository


salve復制線程停止,嘗試start slave 時報ERROR 1872錯誤
mysql> system perror 1872

MySQL error code 1872 (ER_SLAVE_RLI_INIT_REPOSITORY): Slave failed to initialize relay log info structure from the repository
解決過程
1.看樣子是找不到中繼日志的倉庫,但是查看變量relay log的位置是設置了的
mysql> show variables like 'relay%';
+---------------------------+---------------------------------------------------+
| Variable_name | Value |
+---------------------------+---------------------------------------------------+
| relay_log | relay-log |
| relay_log_basename | /datadir/relay-log |
| relay_log_index | /datadir/relay-log.index |
| relay_log_info_file | relay-log.info

2.master.infor中也記錄日志相關的信息,查看后沒有發現異常
3.重置復制信息
mysql> reset master;
Query OK, 0 rows affected (0.00 sec)

mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: 
Master_Host: *******
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: 
Read_Master_Log_Pos: 4
Relay_Log_File: relay-log.000001
Relay_Log_Pos: 4
注意: 依然有復制信息
之后接着
set global gtid_purged='*******';
change master to ......;
start slave時依舊報錯
4.MySQL DOC關於start slave的描述:
RESET SLAVE does not change any replication connection parameters such as master host, master port, master user, or master password, which are retained in memory. This means that START SLAVE can be issued without requiring a CHANGE MASTER TO statement following RESET SLAVE.

Connection parameters are reset by RESET SLAVE ALL.

5.使用reset slave all清空所有的復制信息,然后重置gtid_purged和master.infor
start slave后復制正常


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM