Drbd

drbd 兩個節點不一致,並且過時,如何解決?

  • October 3, 2018

這是我繼承的設置,而且非常舊(執行 drbd 8.3)。我試過了drbdadm connect drbd0drbdadm primary -f drbd0但一切都回來了Need access to UpToDate data

我想那是因為不一致。

[root@node-01 ~]# drbd-overview
 0:drbd0  StandAlone Secondary/Unknown   Inconsistent/Outdated r-----
 1:drbd1  Connected  Secondary/Secondary UpToDate/UpToDate     C      r-----

[root@node-02 ~]# drbd-overview
 0:drbd0  WFConnection Secondary/Unknown   Inconsistent/DUnknown C r-----
 1:drbd1  Connected    Secondary/Secondary UpToDate/UpToDate     C r-----

我怎樣才能解決這個問題,而不用核對它的數據?

當我做drbdadm connect drbd0系統日誌時說:

block drbd0: conn( StandAlone -> Unconnected )
block drbd0: Starting receiver thread (from drbd0_worker [6860])
block drbd0: receiver (re)started
block drbd0: conn( Unconnected -> WFConnection )
block drbd0: Handshake successful: Agreed network protocol version 96
block drbd0: conn( WFConnection -> WFReportParams )
block drbd0: Starting asender thread (from drbd0_receiver [21821])
block drbd0: data-integrity-alg: <not-used>
block drbd0: drbd_sync_handshake:
block drbd0: self AA586D9040BXXXX:7DF55F42BF95XXXX:7DF45F42BF95XXXX:DC31D449C727XXXX bits:416 flags:0
block drbd0: peer 7DF55F42BF9XXXX:0000000000000000:DC31D449C727EE27:DC30D449C727XXXX bits:416 flags:0
block drbd0: uuid_compare()=1 by rule 70
block drbd0: I shall become SyncSource, but I am inconsistent!
block drbd0: conn( WFReportParams -> Disconnecting )
block drbd0: error receiving ReportState, l: 4!
block drbd0: asender terminated
block drbd0: Terminating asender thread
block drbd0: Connection closed
block drbd0: conn( Disconnecting -> StandAlone )
block drbd0: receiver terminated
block drbd0: Terminating receiver thread

兩個節點都沒有數據,所以如果沒有一些說服力UpToDate,DRBD 將無法執行。Primary您需要強制一個節點進入主節點。

您在哪個節點上執行以下命令應該成為SyncSource,因此請確保選擇您認為具有良好數據的節點。

drbdadm -- --overwrite-data-of-peer primary <resource>

如果您不確定,我會disconnect在兩個節點上使用資源,因此它們都是StandAlone,在一個節點上執行上述命令,將該節點提升為Primary,然後檢查數據。然後在另一個節點上重複。一旦你知道好的數據在哪裡,你可以降級雙方,並通過告訴裂腦受害者丟棄他的數據使用:drbdadm -- --discard-my-data connect <resource>,並簡單地連接裂腦倖存者:,以正確的方向解決裂腦問題drbdadm connect <resource>

希望有幫助!

引用自:https://serverfault.com/questions/933644