![drbd 两个节点不一致,且已过期,如何修复?](https://linux22.com/image/727966/drbd%20%E4%B8%A4%E4%B8%AA%E8%8A%82%E7%82%B9%E4%B8%8D%E4%B8%80%E8%87%B4%EF%BC%8C%E4%B8%94%E5%B7%B2%E8%BF%87%E6%9C%9F%EF%BC%8C%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%EF%BC%9F.png)
这是我继承的设置,而且非常旧(运行 drbd 8.3)。我尝试了drbdadm connect drbd0
,drbdadm 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
答案1
两个节点都没有UpToDate
数据,因此 DRBD 在没有得到说服的情况下无法运行Primary
。您需要强制将一个节点设为主节点。
无论在哪个节点上运行以下命令应该成为SyncSource
,因此请确保选择您认为具有良好数据的节点。
drbdadm -- --overwrite-data-of-peer primary <resource>
如果您不确定,我会将disconnect
两个节点上的资源设置为StandAlone
,在一个节点上运行上述命令,将该节点提升为Primary
,然后检查数据。然后在另一个节点上重复此操作。一旦您知道好数据在哪里,您就可以降级双方,并通过告诉裂脑受害者使用:丢弃其数据drbdadm -- --discard-my-data connect <resource>
,并简单地连接裂脑幸存者: ,以正确的方向解决裂脑问题drbdadm connect <resource>
。
希望有帮助!