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

歡迎訪問 生活随笔!

生活随笔

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

数据库

mysql断电同步不起作用_mysql主从同步因断电产生的不能同步问题

發(fā)布時間:2023/12/3 数据库 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql断电同步不起作用_mysql主从同步因断电产生的不能同步问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

偶爾因為斷電導致mysql slave 出現復制錯誤“Could not parse relay log event entry”

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.

先查詢下狀態(tài)

show slave status \G

Master_Host: 192.168.2.51

Master_User: backupuser

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000078

Read_Master_Log_Pos: 984673998

Relay_Log_File: memcached-relay-bin.000039

Relay_Log_Pos: 747157846

Relay_Master_Log_File: mysql-bin.000078

Slave_IO_Running: Yes

Slave_SQL_Running: No

Skip_Counter: 0

Exec_Master_Log_Pos: 747157709

Relay_Log_Space: 984679197

如果可以確定主服務器沒有問題的話,那么重置下從服務器的同步位置就可以了。

如上可以對應的指令為:

stop slave;

CHANGE MASTER TO ?MASTER_LOG_FILE = 'mysql-bin.000078', MASTER_LOG_POS =747157709;

start slave;

再用?show slave status \G 查看狀態(tài)。如下:

Master_Log_File: mysql-bin.000078

Read_Master_Log_Pos: 879029246

Relay_Log_File: memcached-relay-bin.000002

Relay_Log_Pos: 1336369

Relay_Master_Log_File: mysql-bin.000078

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

Relay_Log_Space: 131871772

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

好了到現在搞定了。

還有說法是內存不夠用產生的,有人清除了幾個不用的進程釋放內存后, stop slave; start slave;然后好了,我遇到的不是這個情況,如果你遇到了,按我上面的不能解決的話,可以試著釋放內存看看。

總結

以上是生活随笔為你收集整理的mysql断电同步不起作用_mysql主从同步因断电产生的不能同步问题的全部內容,希望文章能夠幫你解決所遇到的問題。

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