DRBD 资源未恢复在线-Pacemaker + Corosync

DRBD 资源未恢复在线-Pacemaker + Corosync

我使用 DRBD 进行复制。出于测试目的,我使用了 2 台虚拟机。我注意到,如果我断开节点上的网络接口,它会移动到独立模式,而我重新连接后它不会返回到已连接或 WFconnection 模式。有没有办法$drbdadm connect r0使用 Pacemaker 运行或等效运行?
我的配置:

[root@CentOS1 ~]# cat /etc/drbd.d/nfs.res 
resource r0 {

    syncer {
        c-plan-ahead 20;
        c-fill-target 50k;
        c-min-rate 25M;
        al-extents 3833;
        rate 90M;

    }
    disk {

        no-md-flushes;
        fencing resource-only;
    }
    handlers {
        fence-peer "/usr/lib/drbd/crm-fence-peer.sh --timeout 120 --dc-timeout 120";
        after-resync-target "/usr/lib/drbd/crm-unfence-peer.sh";

    }
    net { 

        sndbuf-size 0;
        max-buffers 8000;
        max-epoch-size 8000;    
        after-sb-0pri discard-least-changes;
        after-sb-1pri consensus;
        after-sb-2pri call-pri-lost-after-sb;
    }


    device /dev/drbd0;
    disk /dev/centos/drbd;
    meta-disk internal;

    on CentOS1 {
        address 172.25.1.11:7790;
    }
    on CentOS2 {
        address 172.25.1.12:7790;
    }
}

断网重连后资源状态:

[root@CentOS1 ~]#cat /proc/drbd 
version: 8.4.10-1 (api:1/proto:86-101)
GIT-hash: a4d5de01fffd7e4cde48a080e2c686f9e8cebf4c build by mockbuild@, 2017-09-15 14:23:22
 0: cs:StandAlone ro:Secondary/Unknown ds:UpToDate/Outdated   r-----
    ns:0 nr:0 dw:0 dr:2128 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0

日志:

[root@CentOS2 ~]# cat /dev/kmsg 

6,1171,16427206172,-;e1000: enp0s9 NIC Link is Down
3,1172,16427206435,-;e1000 0000:00:09.0 enp0s9: Reset adapter
 SUBSYSTEM=pci
 DEVICE=+pci:0000:00:09.0
3,1173,16431488757,-;drbd r0: PingAck did not arrive in time.
6,1174,16431488808,-;drbd r0: peer( Secondary -> Unknown ) conn( Connected -> NetworkFailure ) pdsk( UpToDate -> DUnknown ) 
6,1175,16431489116,-;drbd r0: ack_receiver terminated
6,1176,16431489121,-;drbd r0: Terminating drbd_a_r0
6,1177,16431489277,-;block drbd0: new current UUID A5A2A33E423F0679:0F9B7A2A6938EE77:4471A80A92A109A4:4470A80A92A109A4
 SUBSYSTEM=block
 DEVICE=b147:0
6,1178,16431489574,-;drbd r0: Connection closed
6,1179,16431489660,-;drbd r0: conn( NetworkFailure -> Unconnected ) 
6,1180,16431489667,-;drbd r0: receiver terminated
6,1181,16431489669,-;drbd r0: Restarting receiver thread
6,1182,16431489671,-;drbd r0: receiver (re)started
6,1183,16431489712,-;drbd r0: conn( Unconnected -> WFConnection ) 
6,1184,16431489801,-;drbd r0: helper command: /sbin/drbdadm fence-peer r0
4,1185,16431673341,-;drbd r0: helper command: /sbin/drbdadm fence-peer r0 exit code 5 (0x500)
6,1186,16431673351,-;drbd r0: fence-peer helper returned 5 (peer is unreachable, assumed to be dead)
6,1187,16431673374,-;drbd r0: pdsk( DUnknown -> Outdated ) 
3,1188,16450060876,-;drbd r0: bind before connect failed, err = -99
6,1189,16450060962,-;drbd r0: conn( WFConnection -> Disconnecting ) 
4,1190,16461488768,-;drbd r0: Discarding network configuration.
6,1191,16461488824,-;drbd r0: Connection closed
6,1192,16461488855,-;drbd r0: conn( Disconnecting -> StandAlone ) 
6,1193,16461488860,-;drbd r0: receiver terminated
6,1194,16461488862,-;drbd r0: Terminating drbd_r_r0

答案1

没有。除了资源代理在给定操作中返回的代码之外,DRBD 和 Pacemaker 实际上并不了解彼此。

当您将 DRBD 绑定到的接口从其下方拉出时,DRBD 将进入StandAlone。 您只需在执行此操作后重新连接资源:drbdadm connect <res>--或--drbdadm connect all

考虑到网络接口通常不会完全消失,然后在没有管理员参与的情况下重新出现,这似乎没问题。如果您想测试当网络通信中断(数据包丢失)时会发生什么,您应该使用 IP 表规则;然后您会看到 DRBD 进入WFConnection(等待连接)状态,然后返回到Connected删除规则时的状态。

相关内容