• Comments
  • Setting up Pacemaker (pcs) with DRBD

    Posted on

    I am working on a high-availability NFS passive-active cluster with two nodes. I am on RHEL 7.6. Both nodes have DRBD setup on them with two partitions, /prod (/dev/drbd0) and /base (/dev/drbd1).

    The drbd configuration is as follows:

    resource r0 {
      volume 0 {
        device    /dev/drbd0;
        disk      /dev/VG03/prod;
        meta-disk internal;
      }
      volume 1 {
        device    /dev/drbd1;
        disk      /dev/VG03/base;
        meta-disk internal;
      }
      on node1 {
        address   x.x.x.112:7789;
      }
      on node2 {
        address   x.x.x.111:7789;
      }
    }
    

    Now, that's all fine and dandy, but I'm stuck at setting up drbd WITH the cluster.

    I setup the cluster, then ran these commands:

    pcs -f drbd_cfg resource create NFS ocf:linbit:drbd drbd_resource=r0 op monitor interval=60s
    
    pcs -f drbd_cfg resource master r0Clone NFS master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
    
    pcs -f drbd_cfg resource show
    
    pcs cluster cib-push drbd_cfg --config
    

    Those commands are setting up the resource with the cluster, but I haven't yet figured out setting up the file systems.

    Current output of pcs status:

    ken@node1:~$ sudo pcs status
    Cluster name: nfs
    
    WARNINGS:
    No stonith devices and stonith-enabled is not false
    
    Stack: corosync
    Current DC: node2 (version 1.1.19-8.el7_6.5-c3c624ea3d) - partition with quorum
    Last updated: Fri Jun  7 19:48:18 2019
    Last change: Fri Jun  7 17:32:04 2019 by root via cibadmin on node1
    
    2 nodes configured
    2 resources configured
    
    Online: [ node1 node2 ]
    
    Full list of resources:
    
     Master/Slave Set: r0Clone [NFS]
         Masters: [ node1 ]
         Slaves: [ node2 ]
    
    Daemon Status:
      corosync: active/enabled
      pacemaker: active/enabled
      pcsd: active/enabled
    

    Theoretically, would these be the next commands I need to run?

    pcs cluster cib fs_cfg
    
    pcs -f fs_cfg resource create prod Filesystem device="/dev/drbd0" directory="/prod" fstype="xfs"
    
    pcs -f fs_cfg resource create base Filesystem device="/dev/drbd1" directory="/base" fstype="xfs"
    
    pcs -f fs_cfg constraint colocation add prod with r0Clone INFINITY with-rsc-role=Master
    
    pcs -f fs_cfg constraint colocation add base with r0Clone INFINITY with-rsc-role=Master
    
    pcs -f fs_cfg constraint order promote r0Clone then start prod
    
    pcs -f fs_cfg constraint order promote r0Clone then start base
    

    Since I'm working with two volumes, it makes this a little more difficult. Has anybody worked with this before?

    by

    points

    Responses

    Red Hat
    © 2025 Red Hat, Inc.