久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

怎么解決MySQL中the master's binary log is corrupted報錯問題

160次閱讀
沒有評論

共計 3698 個字符,預計需要花費 10 分鐘才能閱讀完成。

本篇內容介紹了“怎么解決 MySQL 中 the master s binary log is corrupted 報錯問題”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓丸趣 TV 小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!

主從復制報錯,下面是從庫復制狀態:

mysql show slave status\G;

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

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 192.168.129.150

                  Master_User: replicat

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000197

          Read_Master_Log_Pos: 213271941

               Relay_Log_File: mysql-relay-bin.000584

                Relay_Log_Pos: 1037392990

        Relay_Master_Log_File: mysql-bin.000195

             Slave_IO_Running: Yes

            Slave_SQL_Running: No

                   Last_Errno: 1594

                   Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master s binary log is corrupted (you can check this by running mysqlbinlog on the binary log), the slave s relay log is corrupted (you can check this by running mysqlbinlog on the relay log), a network problem, or a bug in the master s or slave s MySQL code. If you want to check the master s binary log or slave s relay log, you will be able to know their names by issuing SHOW SLAVE STATUS on this slave.

                 Skip_Counter: 0

          Exec_Master_Log_Pos: 1037392827

              Relay_Log_Space: 2368588837

               Last_SQL_Errno: 1594

               Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master s binary log is corrupted (you can check this by running mysqlbinlog on the binary log), the slave s relay log is corrupted (you can check this by running mysqlbinlog on the relay log), a network problem, or a bug in the master s or slave s MySQL code. If you want to check the master s binary log or slave s relay log, you will be able to know their names by issuing SHOW SLAVE STATUS on this slave.

  Replicate_Ignore_Server_Ids:

             Master_Server_Id: 3

                  Master_UUID: 58c0c354-8652-11e6-bebe-40f2e9ddc532

             Master_Info_File: /data/DB/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: 161018 09:38:49

….

中繼日志讀主庫日志失敗,順道看下錯誤日志信息,日志顯示從庫 9 點 37 分時重啟了,38 分出現主從故障,看樣子是因為從庫異常重啟導致的!

161018 09:37:39 mysqld_safe Number of processes running now: 0

161018 09:37:39 mysqld_safe mysqld restarted

2016-10-18 09:38:49 6042 [ERROR] Slave SQL: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master s binary log is corrupted (you can check this by running mysqlbinlog on the binary log), the slave s relay log is corrupted (you can check this by running mysqlbinlog on the relay log), a network problem, or a bug in the master s or slave s MySQL code. If you want to check the master s binary log or slave s relay log, you will be able to know their names by issuing SHOW SLAVE STATUS on this slave. Error_code: 1594

解決方法,重新設置主從進程解決:

mysql stop slave;

Query OK, 0 rows affected (0.02 sec)

mysql reset slave;

Query OK, 0 rows affected (0.57 sec)

mysql change master to master_host= 192.168.129.150 ,

    – master_user= replicat ,

    – master_password= passw ,

    – master_log_file= mysql-bin.000195 ,

    – master_log_pos=1037392827;

Query OK, 0 rows affected, 2 warnings (0.07 sec)

mysql start slave;

Query OK, 0 rows affected (0.03 sec)

以前從庫異常重啟都沒發生這類情況,網上查了相關資料,發現和 relay_log_info_repository 和 relay_log_info_repository 這兩個參數有關

mysql  show variables like  %relay_log_info_repository%
+—————————+——-+
| Variable_name | Value |
+—————————+——-+
| relay_log_info_repository | FILE |
+—————————+——-+

1 row in set (0.00 sec)

mysql  show variables like  %relay_log_info_repository%
+—————————+——-+
| Variable_name | Value |
+—————————+——-+
| relay_log_info_repository | FILE |
+—————————+——-+

1 row in set (0.00 sec)

把 FILE 修改成 TABLE 可以降低這種主從失敗發生的概率。

“怎么解決 MySQL 中 the master s binary log is corrupted 報錯問題”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注丸趣 TV 網站,丸趣 TV 小編將為大家輸出更多高質量的實用文章!

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-07-19發表,共計3698字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 吉隆县| 达拉特旗| 长沙市| 台中市| 佛冈县| 建平县| 北碚区| 桓仁| 海晏县| 城步| 西城区| 类乌齐县| 永靖县| 南阳市| 固安县| 巴青县| 延吉市| 香港 | 东至县| 长垣县| 柏乡县| 繁峙县| 大新县| 临西县| 铁岭县| 冷水江市| 贵定县| 吐鲁番市| 盐边县| 来凤县| 双柏县| 巴马| 城固县| 弥渡县| 沅江市| 来凤县| 晋中市| 桑日县| 韶关市| 肃宁县| 邛崃市|