免费观看又色又爽又黄的小说免费_美女福利视频国产片_亚洲欧美精品_美国一级大黄大色毛片

mysql中slave_exec_mode如何設置自動跳過同步復制錯誤

小編給大家分享一下MySQL中slave_exec_mode如何設置自動跳過同步復制錯誤,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

站在用戶的角度思考問題,與客戶深入溝通,找到郾城網站設計與郾城網站推廣的解決方案,憑借多年的經驗,讓設計與互聯網技術結合,創造個性化、用戶體驗好的作品,建站類型包括:成都做網站、成都網站制作、成都外貿網站建設、企業官網、英文網站、手機端網站、網站推廣、域名申請、網頁空間、企業郵箱。業務覆蓋郾城地區。

slave_exec_mode設置可以跳過1032(記錄沒有找到)和1062(主鍵重復)錯誤,并記錄到錯誤日志中。

slave_exec_mode和slave_skip_errors作用是一樣的,只是slave_exec_mode可以在線動態設置。slave_skip_errors必須添加到配置文件中,重啟生效。

備庫

mysql> select * from testdb1.student;

+------+------+-------+-------+

| id   | name | class | score |

+------+------+-------+-------+

|    1 | a    | 1     |    45 |

|    2 | b    | 1     |    46 |

|    3 | c    | 2     |    89 |

|    4 | d    | 2     |    90 |

|    5 | e    | 3     |    67 |

|    6 | f    | 3     |    87 |

|    7 | g    | 4     |    77 |

|    8 | h    | 4     |    91 |

+------+------+-------+-------+

8 rows in set (0.00 sec)

mysql> delete from testdb1.student where id >5;

Query OK, 3 rows affected (0.00 sec)

mysql> commit;

Query OK, 0 rows affected (0.00 sec)

#修改參數之前

主庫master

mysql>  delete from testdb1.student where id >7;

Query OK, 1 row affected (0.00 sec)

備庫查看狀態

mysql> show slave status\G

*************************** 1. row ***************************

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 192.168.56.91

                  Master_User: rep

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: ray-bin.000008

          Read_Master_Log_Pos: 1272

               Relay_Log_File: ray-relay-bin.000003

                Relay_Log_Pos: 1226

        Relay_Master_Log_File: ray-bin.000008

             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 testdb1.student; Can't find record in 'student', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log ray-bin.000008, end_log_pos 1241

                 Skip_Counter: 0

          Exec_Master_Log_Pos: 1065

              Relay_Log_Space: 1957

              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 testdb1.student; Can't find record in 'student', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log ray-bin.000008, end_log_pos 1241

  Replicate_Ignore_Server_Ids:

             Master_Server_Id: 2

                  Master_UUID: 840f94e0-8ea0-11e5-af92-080027a94012

             Master_Info_File: /data/3307/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: 151126 12:42:37

               Master_SSL_Crl:

           Master_SSL_Crlpath:

           Retrieved_Gtid_Set:

            Executed_Gtid_Set:

                Auto_Position: 0

1 row in set (0.00 sec)

mysql> stop slave;

Query OK, 0 rows affected (0.78 sec)

mysql> set global sql_slave_skip_counter=1;

Query OK, 0 rows affected (0.01 sec)

mysql> start slave;

Query OK, 0 rows affected (0.33 sec)

#修改備庫參數

mysql> show variables like '%slave_exec_mode%';

+-----------------+--------+

| Variable_name   | Value  |

+-----------------+--------+

| slave_exec_mode | STRICT |

+-----------------+--------+

1 row in set (0.00 sec)

mysql> set global slave_exec_mode=idempotent;

Query OK, 0 rows affected (0.00 sec)

mysql> show variables like '%slave_exec_mode%';

+-----------------+------------+

| Variable_name   | Value      |

+-----------------+------------+

| slave_exec_mode | IDEMPOTENT |

+-----------------+------------+

1 row in set (0.00 sec)

主庫刪除數據

mysql>  delete from testdb1.student where id >6;

Query OK, 1 row affected (0.01 sec)

mysql> commit;

Query OK, 0 rows affected (0.00 sec)

備庫查看狀態和錯誤日志

mysql> show slave status\G

*************************** 1. row ***************************

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 192.168.56.91

                  Master_User: rep

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: ray-bin.000008

          Read_Master_Log_Pos: 1479

               Relay_Log_File: ray-relay-bin.000004

                Relay_Log_Pos: 488

        Relay_Master_Log_File: ray-bin.000008

             Slave_IO_Running: Yes

            Slave_SQL_Running: Yes

              Replicate_Do_DB:

          Replicate_Ignore_DB:

           Replicate_Do_Table:

       Replicate_Ignore_Table:

      Replicate_Wild_Do_Table:

  Replicate_Wild_Ignore_Table:

                   Last_Errno: 0

                   Last_Error:

                 Skip_Counter: 0

          Exec_Master_Log_Pos: 1479

              Relay_Log_Space: 1972

              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: 0

Master_SSL_Verify_Server_Cert: No

                Last_IO_Errno: 0

                Last_IO_Error:

               Last_SQL_Errno: 0

               Last_SQL_Error:

  Replicate_Ignore_Server_Ids:

             Master_Server_Id: 2

                  Master_UUID: 840f94e0-8ea0-11e5-af92-080027a94012

             Master_Info_File: /data/3307/data/master.info

                    SQL_Delay: 0

          SQL_Remaining_Delay: NULL

      Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it

           Master_Retry_Count: 86400

                  Master_Bind:

      Last_IO_Error_Timestamp:

     Last_SQL_Error_Timestamp:

               Master_SSL_Crl:

           Master_SSL_Crlpath:

           Retrieved_Gtid_Set:

            Executed_Gtid_Set:

                Auto_Position: 0

1 row in set (0.00 sec)

[root@ray ~]# tail -20f /data/3307/data/mysql_ray.err

2015-11-26 12:50:29 12127 [Warning] Slave SQL: Could not execute Delete_rows event on table testdb1.student; Can't find record in 'student', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log ray-bin.000008, end_log_pos 1655, Error_code: 1032

注:pos可能對不上,因為截取的問題,不必在意。

以上是“mysql中slave_exec_mode如何設置自動跳過同步復制錯誤”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注創新互聯行業資訊頻道!

本文題目:mysql中slave_exec_mode如何設置自動跳過同步復制錯誤
分享鏈接:http://m.newbst.com/article22/jicijc.html

成都網站建設公司_創新互聯,為您提供域名注冊網站建設手機網站建設網站收錄建站公司定制網站

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

成都定制網站建設