關於SQLyog操作Mysql雙主、主從同步異常問題

來源:互聯網
上載者:User

標籤:mysql   error   sync   


本人遇到的問題發生在mysql 5.6.21 M-M中:

Master1 Server version: 5.6.21-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)

Master2 Server version: 5.6.21-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)

Master1 Os version: CentOS release 6.5 (Final) 

Master2 Os version: CentOS release 6.5 (Final) 


同步相關參數:

Master1:

server-id=1

log-slave-updates

auto_increment_increment=2

auto_increment_offset=1

replicate-do-db=*****

relay_log_recovery

Master2:

server-id=2

log-slave-updates

auto_increment_increment=2

auto_increment_offset=2

replicate-do-db=*****

relay_log_recovery


問題描述:

SQLyog對Master1做DML操作時,記錄未同步到Master2對應庫表裡;使用其他工具操作mysql,同步正常


排查過程:

1.首先查看Master1和Master2的master、slave狀態,均顯示基本正常;

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

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

2.然後查看errlog,無相關錯誤資訊


3.用mysqlbinlog解析master2的relay log和binlog,發現在relay log中存在SQLyog工具的DML語句,但是在binlog裡面沒有出現該DML語句


相關分析:

在“slave” 的relay中找到了相關sql,但是在binlog中沒找到該sql,說明salve I/O線程日誌的同步正常;只是slave SQL線程執行SQL有異常,

但是查看master和slave的狀態,均顯示正常,而且無報錯資訊。網上尋找相關資料,發現幾個SQLyog同步問題比較典型的文章,但均無解決辦

法:

http://blog.csdn.net/linvo/article/details/6566215

http://bbs.csdn.net/topics/390672280


如果是用戶端工具導致主主、主從同步異常的話,感覺解釋起來有點太牽強,理論上講不通,除非是mysql Slave_SQL_Running線程對

SQLyog的語句解析異常,直接跳過了SQLyog編譯出的sql,這麼解釋還是感覺有點問題;但是說回來,用其他工具來操作mysql,同步正常無異

常。總之感覺有點怪異。


請求大神們能幫忙解釋一下此問題。



關於SQLyog操作Mysql雙主、主從同步異常問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.