一次MySQL主从异常的记录
主备级联架构:A→B→C
0 1 2 |
Slave_IO_Running: Yes Slave_SQL_Running: Yes Seconds_Behind_Master: 4410 |
中途重新启动后发现:
0 1 2 3 4 |
mysql> show slave status\G Empty set (0.00 sec) mysql> change master to master_host='1.1.1.1',MASTER_PORT=3306,master_user='tongbu',master_password='123456',master_auto_position=1; ERROR 1794 (HY000): Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log. |
错误日志:
0 1 2 3 4 |
2017-05-12T00:45:14.044460Z 3 [Note] @@GLOBAL.GTID_PURGED was changed from '' to '78488ade-7dfc-11e7-ad71-0163e00dadd:1-114140'. 2017-05-12T00:45:14.044516Z 3 [Note] @@GLOBAL.GTID_EXECUTED was changed from '' to '78488ade-7dfc-11e7-ad71-0163e00dadd:1-114140'. 2017-05-12T00:59:46.749818Z 0 [ERROR] Slave: Multiple repository instances found with data in them. Unable to decide which is the correct one to choose 2017-05-12T00:59:46.749849Z 0 [ERROR] Failed to create or recover replication info repositories. |
解决方法:SourceByrd's Blog-https://note.t4x.org/database/mysql-master-slave-error/
SourceByrd's Blog-https://note.t4x.org/database/mysql-master-slave-error/SourceByrd's Blog-https://note.t4x.org/database/mysql-master-slave-error/1:首先发现从库的版本比主库的版本高一个级别,因此调整从库和主库相同;
2:错误日志报错发现Executed_Gtid_Set是A的ID,而不是B的ID。
3:判断由于B库做主备的时候没有进行锁表等操作,刚刚还原也没有重新启动数据库导致。 SourceByrd's Blog-https://note.t4x.org/database/mysql-master-slave-error/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!