The Pacemaker based RabbitMQ server requires a DRBD resource from
which it mounts the /var/lib/rabbitmq directory. In this example,
the DRBD resource is simply named rabbitmq:
rabbitmq DRBD resource configuration (/etc/drbd.d/rabbitmq.res).
resource rabbitmq {
device minor 1;
disk "/dev/data/rabbitmq";
meta-disk internal;
on node1 {
address ipv4 10.0.42.100:7701;
}
on node2 {
address ipv4 10.0.42.254:7701;
}
}
This resource uses an underlying local disk (in DRBD terminology, a
backing device) named /dev/data/rabbitmq on both cluster nodes,
node1 and node2. Normally, this would be an LVM Logical Volume
specifically set aside for this purpose. The DRBD meta-disk is
internal, meaning DRBD-specific metadata is being stored at the end
of the disk device itself. The device is configured to communicate
between IPv4 addresses 10.0.42.100 and 10.0.42.254, using TCP port
7701. Once enabled, it will map to a local DRBD block device with the
device minor number 1, that is, /dev/drbd1.
Enabling a DRBD resource is explained in detail in the DRBD User’s Guide. In brief, the proper sequence of commands is this:
drbdadm create-md rabbitmqdrbdadm up rabbitmq
drbdadm -- --force primary rabbitmq
Initializes DRBD metadata and writes the initial set of metadata
to | |
Creates the | |
Kicks off the initial device synchronization, and puts the device
into the |

drbdadm up rabbitmq
drbdadm -- --force primary rabbitmq 
