從基于日志的復(fù)制到基于事務(wù)的復(fù)制總是提示出錯(cuò),求助高手
在日志模式復(fù)制時(shí)都很正常,一切換到基于事務(wù)模式就提示以下錯(cuò)誤,納悶ing.......
基于日志時(shí)可以指定復(fù)制的log和position,但切換到事務(wù)模式時(shí)貌似會(huì)從很早的時(shí)候重做,不知道該怎么救火,求高手
mysql> show slave status \G
*************************** 1. row ***************************
? ? ? ? ? ? ? ?Slave_IO_State: Waiting for master to send event
? ? ? ? ? ? ? ? ? Master_Host: 192.168.16.140
? ? ? ? ? ? ? ? ? Master_User: dba
? ? ? ? ? ? ? ? ? Master_Port: 3306
? ? ? ? ? ? ? ? Connect_Retry: 60
? ? ? ? ? ? ? Master_Log_File: mysql-bin.000035
? ? ? ? ? Read_Master_Log_Pos: 194
? ? ? ? ? ? ? ?Relay_Log_File: localhost-relay-bin.000002
? ? ? ? ? ? ? ? Relay_Log_Pos: 414
? ? ? ? Relay_Master_Log_File: mysql-bin.000014
? ? ? ? ? ? ?Slave_IO_Running: Yes
? ? ? ? ? ? Slave_SQL_Running: No
? ? ? ? ? ? ? Replicate_Do_DB:?
? ? ? ? ? Replicate_Ignore_DB:?
? ? ? ? ? ?Replicate_Do_Table:?
? ? ? ?Replicate_Ignore_Table:?
? ? ? Replicate_Wild_Do_Table:?
? Replicate_Wild_Ignore_Table:?
? ? ? ? ? ? ? ? ? ?Last_Errno: 1032
? ? ? ? ? ? ? ? ? ?Last_Error: Could not execute Delete_rows event on table dba.t; Can't find record in 't', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000014, end_log_pos 744
? ? ? ? ? ? ? ? ?Skip_Counter: 0
? ? ? ? ? Exec_Master_Log_Pos: 452
? ? ? ? ? ? ? Relay_Log_Space: 10758
? ? ? ? ? ? ? Until_Condition: None
? ? ? ? ? ? ? ?Until_Log_File:?
? ? ? ? ? ? ? ? Until_Log_Pos: 0
? ? ? ? ? ?Master_SSL_Allowed: No
? ? ? ? ? ?Master_SSL_CA_File:?
? ? ? ? ? ?Master_SSL_CA_Path:?
? ? ? ? ? ? ? Master_SSL_Cert:?
? ? ? ? ? ? Master_SSL_Cipher:?
? ? ? ? ? ? ? ?Master_SSL_Key:?
? ? ? ? Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
? ? ? ? ? ? ? ? Last_IO_Errno: 0
? ? ? ? ? ? ? ? Last_IO_Error:?
? ? ? ? ? ? ? ?Last_SQL_Errno: 1032
? ? ? ? ? ? ? ?Last_SQL_Error: Could not execute Delete_rows event on table dba.t; Can't find record in 't', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000014, end_log_pos 744
? Replicate_Ignore_Server_Ids:?
? ? ? ? ? ? ?Master_Server_Id: 1
? ? ? ? ? ? ? ? ? Master_UUID: 1e4c5982-901f-11e8-968c-000c29c409e8
? ? ? ? ? ? ?Master_Info_File: /data/mysql/master.info
? ? ? ? ? ? ? ? ? ? SQL_Delay: 0
? ? ? ? ? SQL_Remaining_Delay: NULL
? ? ? Slave_SQL_Running_State:?
? ? ? ? ? ?Master_Retry_Count: 86400
? ? ? ? ? ? ? ? ? Master_Bind:?
? ? ? Last_IO_Error_Timestamp:?
? ? ?Last_SQL_Error_Timestamp: 180807 19:19:43
? ? ? ? ? ? ? ?Master_SSL_Crl:?
? ? ? ? ? ?Master_SSL_Crlpath:?
? ? ? ? ? ?Retrieved_Gtid_Set: 1e4c5982-901f-11e8-968c-000c29c409e8:3-4
? ? ? ? ? ? Executed_Gtid_Set: 1e4c5982-901f-11e8-968c-000c29c409e8:1-2:5,
f897b6a2-8fa6-11e8-b946-000c29a0453f:1-256
? ? ? ? ? ? ? ? Auto_Position: 1
? ? ? ? ?Replicate_Rewrite_DB:?
? ? ? ? ? ? ? ? ?Channel_Name:?
? ? ? ? ? ?Master_TLS_Version:?
1 row in set (0.00 sec)
2018-12-14
主從的數(shù)據(jù)庫(kù)數(shù)據(jù)不一致,在從庫(kù)執(zhí)行刪除行時(shí)候,找不到相應(yīng)的數(shù)據(jù),所以報(bào)錯(cuò)
2018-09-28
Slave_SQL_Running停止,主庫(kù)和備庫(kù)的數(shù)據(jù)不一致,同步的時(shí)候備庫(kù)找不到相關(guān)的數(shù)據(jù),錯(cuò)誤位置是mysql-bin.000014,end_log_pos 744.
先在備庫(kù)備份恢復(fù)主庫(kù)的數(shù)據(jù),再開(kāi)始復(fù)制。