mysql 脑裂的问题,DRBD脑裂问题故障处理
環境:Mysql+heartbeat+drbd 架構
問題:mysql-主 宕機 mysql-從接替之后,再恢復Mysql-主之后,發現主的drbd啟動不了,而且從上面也無法辨識對方,從的狀態是Primary/Unknown ,主的狀態是Secondary/Unknown
查看從節點的日志發現腦裂:[root@node2 ~]# tail -n 12 /var/log/messagesSep 21 11:19:53 lab4 kernel: block drbd0: Split-Brain detected but unresolved, dropping connection!Sep 21 11:19:53 lab4 kernel: block drbd0: helper command: /sbin/drbdadm split-brain minor-0Sep 21 11:19:53 lab4 kernel: block drbd0: helper command: /sbin/drbdadm split-brain minor-0 exit code 0 (0x0)Sep 21 11:19:53 lab4 kernel: block drbd0: conn( WFReportParams -> Disconnecting )Sep 21 11:19:53 lab4 kernel: block drbd0: error receiving ReportState, l: 4!Sep 21 11:19:53 lab4 kernel: block drbd0: meta connection shut down by peer.Sep 21 11:19:53 lab4 kernel: block drbd0: asender terminatedSep 21 11:19:53 lab4 kernel: block drbd0: Terminating drbd0_asenderSep 21 11:19:53 lab4 kernel: block drbd0: Connection closedSep 21 11:19:53 lab4 kernel: block drbd0: conn( Disconnecting -> StandAlone )Sep 21 11:19:53 lab4 kernel: block drbd0: receiver terminatedSep 21 11:19:53 lab4 kernel: block drbd0: Terminating drbd0_receiver
此時的環境是從節點的heartbeat、mysql啟動,頂替主的工作,從節點的drbd狀態是Primary/Unknown,并且已經掛載著 ?/dev/drbd0 ?/data ?,主節點的狀態是未啟動heartbeat和mysql 并且啟動drbd的時候報錯。
恢復過程:
將主節點設置為從節點并丟棄資源數據
[root@node1 ~]# drbdadm secondary r0
[root@node1 ~]# drbdadm -- --discard-my-data connect r0
在從節點上手動連接資源
[root@node2 ~]# drbdadm connect r0
最后查看節點狀態,連接已恢復正常[root@node1 ~]# cat /proc/drbdversion: 8.3.15 (api:88/proto:86-97)GIT-hash: 0ce4d235fc02b5c53c1c52c53433d11a694eab8c build by mockbuild@builder17.centos.org, 2013-03-27 16:04:080: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----ns:36 nr:0 dw:24 dr:185 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0
此時再啟動主節點的heartbeat 即可!
總結
以上是生活随笔為你收集整理的mysql 脑裂的问题,DRBD脑裂问题故障处理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php gzipstream,c# –
- 下一篇: qq韩文个性签名大全