2017-05-30 11 views
0

私はMySQLレプリケーションを設定しており、うまくいきました。偶然、私はスレーブ上のいくつかのユーザーを削除/修正し、Master上で同じアクションを実行しました。その後複製が停止し、私が試してみました `ショースレーブステータスの\ G」GTIDでmysqlレプリケーションが失敗し、それを回復できません

mysql> show slave status \G 
*************************** 1. row *************************** 
       Slave_IO_State: Waiting for master to send event 
        Master_Host: mysql-servers01 
        Master_User: mysqlreplica 
        Master_Port: 3306 
       Connect_Retry: 60 
       Master_Log_File: mysql-bin.000002 
      Read_Master_Log_Pos: 1346 
       Relay_Log_File: mysql-servers02-relay-bin.000002 
       Relay_Log_Pos: 4681 
     Relay_Master_Log_File: mysql-bin.000001 
      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 mysql.user; Can't find record in 'user', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000001, end_log_pos 4974 
       Skip_Counter: 0 
      Exec_Master_Log_Pos: 4468 
       Relay_Log_Space: 9096 
       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 mysql.user; Can't find record in 'user', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000001, end_log_pos 4974 
    Replicate_Ignore_Server_Ids: 
      Master_Server_Id: 1 
        Master_UUID: aaa2545a-4437-11e7-9f03-0021f6f0406f 
      Master_Info_File: mysql.slave_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: 170529 21:06:36 
       Master_SSL_Crl: 
      Master_SSL_Crlpath: 
      Retrieved_Gtid_Set: aaa2545a-4437-11e7-9f03-0021f6f0406f:1-31 
      Executed_Gtid_Set: aaa2545a-4437-11e7-9f03-0021f6f0406f:1-20:31, 
acc29e29-4437-11e7-8074-0021f6f0406e:1-23 
       Auto_Position: 0 
     Replicate_Rewrite_DB: 
       Channel_Name: 
      Master_TLS_Version: 
1 row in set (0.00 sec) 

mysql> 

にエラーの下に与えるメッセージの下に与えるSET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1

mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; 
ERROR 1858 (HY000): sql_slave_skip_counter can not be set when the server is running with @@GLOBAL.GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction 

を設定し、Iもまた、アクションその下にしようとしています助けてくれませんでした。

mysql> STOP SLAVE; 
Query OK, 0 rows affected (0.00 sec) 

mysql> SET GTID_NEXT="aaa2545a-4437-11e7-9f03-0021f6f0406f:20" 
    -> ; 
Query OK, 0 rows affected (0.00 sec) 

mysql> BEGIN; COMMIT; 
Query OK, 0 rows affected (0.00 sec) 

Query OK, 0 rows affected (0.00 sec) 

mysql> SET GTID_NEXT="acc29e29-4437-11e7-8074-0021f6f0406e:23"; 
Query OK, 0 rows affected (0.01 sec) 

mysql> BEGIN; COMMIT; 
Query OK, 0 rows affected (0.00 sec) 

Query OK, 0 rows affected (0.00 sec) 

mysql> SET GTID_NEXT="aaa2545a-4437-11e7-9f03-0021f6f0406f:31"; 
Query OK, 0 rows affected (0.00 sec) 

mysql> BEGIN; COMMIT; 
Query OK, 0 rows affected (0.00 sec) 

Query OK, 0 rows affected (0.00 sec) 

mysql> SET GTID_NEXT="AUTOMATIC"; 
Query OK, 0 rows affected (0.01 sec) 

mysql> START SLAVE; 
Query OK, 0 rows affected (0.00 sec) 

これを復元して複製を正しく行う方法はありますか?

答えて

0

MySQLをスレーブノードに再インストールしてもう一度設定しました。

関連する問題