drbd腦裂徹底解決

zdt71發表於2014-03-26
發現由於啟動順序錯誤(透過snapshot恢復功能)。好像造成mysql伺服器用的drbd裝置的腦裂。

在選定的非主節點上執行
drbdadm secondary mysql
drbdadm -- --discard-my-data connect mysql
主節點上執行
drbdadm connect mysql 

總是不成功 
發現兩臺機器確實進行過連線,但是不能正確的決定關係。
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: Handshake successful: Agreed network protocol version 101
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: Agreed to support TRIM on protocol level
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: conn( WFConnection -> WFReportParams )
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: Starting asender thread (from drbd_r_mysql [30139])
Mar 26 09:58:42 hacontroller2 kernel: block drbd0: drbd_sync_handshake:
Mar 26 09:58:42 hacontroller2 kernel: block drbd0: self 5C25C478F3ACE6BE:28E2D98C86D01F89:076A48FD642993B9:076948FD642993B9 bits:75 flags:0
Mar 26 09:58:42 hacontroller2 kernel: block drbd0: peer C596BFE91962551F:076948FD642993B8 F5C06A38B650A2D4:F5BF6A38B650A2D5 bits:4985 flags:0
Mar 26 09:58:42 hacontroller2 kernel: block drbd0: uuid_compare()=-1000 by rule 100 Mar 26 09:58:42 hacontroller2 kernel: block drbd0: Unrelated data, aborting!
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: conn( WFReportParams -> Disconnecting )
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: error receiving ReportState, e: -5 l: 0!
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: asender terminated
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: Terminating drbd_a_mysql
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: Connection closed
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: conn( Disconnecting -> StandAlone )
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: receiver terminated
Mar 26 09:58:42 hacontroller2 kernel: drbd mysql: Terminating drbd_r_mysql

察看上面紅字。

最後透過以下方法進行解決。
在secondary接點重新初始化資料。
  
drbdadm detach mysql
dd if=/dev/zero bs=1M count=100 of=/dev/sdb1
drbdadm down mysql
drbdadm create-md mysql

在主節點上執行
drbdadm connect mysql

後發現開始同步。 
[root@hacontroller1 python]# cat /proc/drbd
version: 8.4.4 (api:1/proto:86-101)
GIT-hash: 599f286440bd633d15d5ff985204aff4bccffadd build by phil@Build64R6, 2013-10-14 15:33:06
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r-----
    ns:195604 nr:0 dw:784 dr:206856 al:6 bm:11 lo:0 pe:3 ua:0 ap:0 ep:1 wo:f oos:10287976
        [>....................] sync'ed:  2.0% (10044/10236)M
        finish: 0:17:08 speed: 9,988 (8,820) K/sec
 1: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
    ns:484 nr:8 dw:492 dr:841 al:4 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18455/viewspace-1129709/,如需轉載,請註明出處,否則將追究法律責任。

相關文章