admin管理员组

文章数量:1550528

机房掉电,数据库非正常关机。MySQL拉起后,从库报如下错误。

  Last_IO_Errno: 1236
  Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replicated to the slave. Suggest to replicate any transactions that master has rolled back from slave to master, and/or commit empty transactions on master to account for transactions that have been'

Executed_Gtid_Set: 78baf053-b460-11ea-9b26-b82a72d58ac1:1-3,
f738f1f9-b466-11ea-a7b4-b82a72d58ac1:1-169102298

原因: 没有设置sync_binlog = 1

解决方法:

1.主库设置比从库大的GTID.

mysql> SET SESSION GTID_NEXT='f738f1f9-b466-11ea-a7b4-b82a72d58ac1:169102299';    
Query OK, 0 rows affected (0.00 sec)

mysql> begin ; commit; set gtid_next='automatic';

 

2.从库

stop slave;start slave; show slave status; 

 

 

 

 

 

 

 

本文标签: GTIDsSlaveSERVERUUIDMaster