主從問題處理記錄

mysql> show slave status\G;
*************************** 1. row ***************************
               Slave_IO_State: 
                  Master_Host: 192.168.160.101
                  Master_User: vemssms
                  Master_Port: 3307
                Connect_Retry: 10
              Master_Log_File: mysqlbin.000024
          Read_Master_Log_Pos: 595918761
               Relay_Log_File: snbc-ssms-swarm-centos7-01-relay-bin.000088
                Relay_Log_Pos: 48512702
        Relay_Master_Log_File: mysqlbin.000024
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: vems_statis.%
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 595918761
              Relay_Log_Space: 48512930
              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: 1047
                Last_IO_Error: The slave I/O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master. Error: WSREP has not yet prepared node for application use
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 150
                  Master_UUID: b4d7c925-a6c6-11e9-8866-525400a9489f
             Master_Info_File: /data/mysql/data/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 190730 06:32:58
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 
                Auto_Position: 0
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Master_TLS_Version: 
1 row in set (0.00 sec)

ERROR: 
No query specified

1.這個錯誤直接重新啓動從服務即可

stop slave;
start slave;

>show slave status\G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.160.101
                  Master_User: vemssms
                  Master_Port: 3307
                Connect_Retry: 10
              Master_Log_File: mysqlbin.000028
          Read_Master_Log_Pos: 52226299
               Relay_Log_File: snbc-ssms-swarm-centos7-01-relay-bin.000091
                Relay_Log_Pos: 23125312
        Relay_Master_Log_File: mysqlbin.000026
             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: vems_statis.%
                   Last_Errno: 1032
                   Last_Error: Could not execute Delete_rows event on table vems.t_anal_pool_m_vcount; Can't find record in 't_anal_pool_m_vcount', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysqlbin.000026, end_log_pos 23133510
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 23125101
              Relay_Log_Space: 161927129
              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 vems.t_anal_pool_m_vcount; Can't find record in 't_anal_pool_m_vcount', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysqlbin.000026, end_log_pos 23133510
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 150
                  Master_UUID: b4d7c925-a6c6-11e9-8866-525400a9489f
             Master_Info_File: /data/mysql/data/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: 190730 11:19:46
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 
                Auto_Position: 0
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Master_TLS_Version: 
1 row in set (0.00 sec)

ERROR: 
No query specified
  1. 以下這是因爲統計類的sql主從不一致導致的,因爲統計類業務已不在主節點操作,所以可以直接使用參數replicate-wild-ignore-table = “vems.t_anal_pool%” 忽視統計類表的同步語句

Could not execute Delete_rows event on table vems.t_anal_pool_m_vcount; Can’t find record in ‘t_anal_pool_m_vcount’, Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event’s master log mysqlbin.000026,

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章