Slave failed to initialize relay log info structure from the repository

it2022-05-25  72

更改了从库的 relaylog 的位置 ,导致从库异常。

1、查看 mysql.slave_relay_log_info 表,发现中继日志还是指向原来的文件。

mysql> select * from mysql.slave_relay_log_info \G *************************** 1. row *************************** Number_of_lines: 7 Relay_log_name: ./mysql-slave-relay-bin-bala_ec.001598 Relay_log_pos: 31013082 Master_log_name: mysql-bin.000533 Master_log_pos: 31012869 Sql_delay: 0 Number_of_workers: 0 Id: 1 Channel_name: bala_ec

查看mysql.slave_master_info 表:

mysql> select * from mysql.slave_master_info \G *************************** 1. row *************************** Number_of_lines: 25 Master_log_name: mysql-bin.000533 Master_log_pos: 31012869 Host: 10.5*.*.* User_name: User_password: Port: 3306 Connect_retry: 60 Enabled_ssl: 0 Ssl_ca: Ssl_capath: Ssl_cert: Ssl_cipher: Ssl_key: Ssl_verify_server_cert: 0 Heartbeat: 30 Bind: Ignored_server_ids: 0 Uuid: ebb0f797-b953-11e8-9101-c81f66f93122 Retry_count: 86400 Ssl_crl: Ssl_crlpath: Enabled_auto_position: 0 Channel_name: bala_ec Tls_version:

2、执行 reset slave , 清空 mysql.slave_relay_log_info 表中的数据。

 

3、重新配置下 主从,相关信息可以从mysql.slave_master_info 中获取:

change master to master_host='*。*。*。*',master_user='slave001',master_password='123456',master_log_file='mysql-bin.000533',master_log_pos=31012869 FOR CHANNEL 'bala_ec';

4、重新启动slave ,同步正常。

 

 

 


最新回复(0)