You may now proceed with adding the Pacemaker configuration for
RabbitMQ resources. Connect to the Pacemaker cluster with crm
configure, and add the following cluster resources:
primitive p_ip_rabbitmp ocf:heartbeat:IPaddr2 \
params ip="192.168.42.100" cidr_netmask="24" \
op monitor interval="10s"
primitive p_drbd_rabbitmq ocf:linbit:drbd \
params drbd_resource="rabbitmq" \
op start timeout="90s" \
op stop timeout="180s" \
op promote timeout="180s" \
op demote timeout="180s" \
op monitor interval="30s" role="Slave" \
op monitor interval="29s" role="Master"
primitive p_fs_rabbitmq ocf:heartbeat:Filesystem \
params device="/dev/drbd/by-res/rabbitmq" \
directory="/var/lib/rabbitmq" \
fstype="xfs" options="relatime" \
op start timeout="60s" \
op stop timeout="180s" \
op monitor interval="60s" timeout="60s"
primitive p_rabbitmq ocf:rabbitmq:rabbitmq-server \
params nodename="rabbit@localhost" \
mnesia_base="/var/lib/rabbitmq" \
op monitor interval="20s" timeout="10s"
group g_rabbitmq p_ip_rabbitmq p_fs_rabbitmq p_rabbitmq
ms ms_drbd_rabbitmq p_drbd_rabbitmq \
meta notify="true" master-max="1" clone-max="2"
colocation c_rabbitmq_on_drbd inf: g_rabbitmq ms_drbd_rabbitmq:Master
order o_drbd_before_rabbitmq inf: ms_drbd_rabbitmq:promote g_rabbitmq:startThis configuration creates
p_ip_rabbitmp, a virtual IP address for use by RabbitMQ (192.168.42.100),p_fs_rabbitmq, a Pacemaker managed filesystem mounted to/var/lib/rabbitmqon whatever node currently runs the RabbitMQ service,ms_drbd_rabbitmq, the master/slave set managing therabbitmqDRBD resource,-
a service
groupandorderandcolocationconstraints to ensure resources are started on the correct nodes, and in the correct sequence.
crm configure supports batch input, so you may copy and paste the
above into your live pacemaker configuration, and then make changes as
required. For example, you may enter edit p_ip_rabbitmq from the
crm configure menu and edit the resource to match your preferred
virtual IP address.
Once completed, commit your configuration changes by entering commit
from the crm configure menu. Pacemaker will then start the RabbitMQ
service, and its dependent resources, on one of your nodes.

