日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

MySQL Replication Error 处理一例

發布時間:2025/3/15 数据库 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MySQL Replication Error 处理一例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

故障現象

MySQL slave status詳情

mysql> show slave status\G *************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 10.10.10.101Master_User: rootMaster_Port: 3306Connect_Retry: 60Master_Log_File: mysql-bin.000010Read_Master_Log_Pos: 143861468Relay_Log_File: slave-relay-bin.000525Relay_Log_Pos: 128835579Relay_Master_Log_File: mysql-bin.000010Slave_IO_Running: YesSlave_SQL_Running: NoReplicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: mysql.%,information_schema.%,test.%Last_Errno: 0Last_Error: Could not parse relay log event entry. The possck this by running 'mysqlbinlog' on the binary log), the slave's relay log iay log), a network problem, or a bug in the master's or slave's MySQL code. you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this Skip_Counter: 0Exec_Master_Log_Pos: 128835442Relay_Log_Space: 143862393Until_Condition: NoneUntil_Log_File: Until_Log_Pos: 0Master_SSL_Allowed: NoMaster_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL 1 row in set (0.00 sec)mysql>

?

MySQL 錯誤日志中顯示了問題的根源,磁盤空間滿.

thatsit-mysql:/var/lib/mysql # grep -i disk mysqld.log-20160114 /usr/sbin/mysqld: Disk is full writing './mysql-bin.000319' (Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space) /usr/sbin/mysqld: Disk is full writing './mysql-bin.000320' (Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space) thatsit-mysql:/var/lib/mysql #

MySQL 錯誤日志中同樣還記錄了binlog執行截至的位置點.

thatsit-mysql:/var/lib/mysql # grep ERROR mysqld.log-20160114|grep stopped|tail -1 160114 13:16:16 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000010' position 128835442 thatsit-mysql:/var/lib/mysql #

修復

① 清理MySQL datadir所在的磁盤

② 恢復MySQL SLAVE (STOP SLAVE → CHANGE MASTER → START SLAVE)

※: 位置點為上面從SLAVE STATUS的"Exec_Master_Log_Pos"或者錯誤日志中獲取的.

mysql> stop slave; Query OK, 0 rows affected (0.00 sec)mysql> mysql> CHANGE MASTER TO-> MASTER_HOST='10.10.10.101',-> MASTER_PORT=3306,-> MASTER_USER='REP_USER',-> MASTER_PASSWORD='REP_PASSWORD',-> MASTER_LOG_FILE='mysql-bin.000010',-> MASTER_LOG_POS=128835442; Query OK, 0 rows affected (0.41 sec)mysql> start slave; Query OK, 0 rows affected (0.00 sec)

mysql>

操作后狀態確認

mysql> show slave status\G *************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 10.10.10.101Master_User: rootMaster_Port: 3306Connect_Retry: 60Master_Log_File: mysql-bin.000010Read_Master_Log_Pos: 144444705Relay_Log_File: slave-relay-bin.000002Relay_Log_Pos: 38259Relay_Master_Log_File: mysql-bin.000010Slave_IO_Running: YesSlave_SQL_Running: YesReplicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: mysql.%,information_schema.%,test.%Last_Errno: 0Last_Error: Skip_Counter: 0Exec_Master_Log_Pos: 128873466Relay_Log_Space: 15609498Until_Condition: NoneUntil_Log_File: Until_Log_Pos: 0Master_SSL_Allowed: NoMaster_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 99299 1 row in set (0.00 sec)mysql>

?

此故障至此修復完畢.

?

轉載于:https://www.cnblogs.com/thatsit/p/5133140.html

總結

以上是生活随笔為你收集整理的MySQL Replication Error 处理一例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。