DRBD Failed with pacemaker

corosyncdrbdfailedpacemaker

I'm new with Pacemaker and DRBD but I have to configure them together.
I created 2 drbd resources : Drbdwww and DrbdMysql
But when I use drbd_mon I have the following errors :

Stack: corosync
Current DC: s-ha-web1 (version 1.1.15-e174ec8) - partition with quorum
Last updated: Mon May  8 21:58:45 2017          Last change: Mon May  8 21:58:36 2017 by hacluster via crmd on s-ha-web1

2 nodes and 7 resources configured

Online: [ s-ha-web1 s-ha-web2 ]

 Resource Group: haweb
     vip        (ocf::heartbeat:IPaddr2):       Started s-ha-web1
     httpd      (ocf::heartbeat:apache):        Started s-ha-web1
     Drbdwww    (ocf::linbit:drbd):     FAILED (blocked)[ s-ha-web1 s-ha-web2 ]
     fsDrbdwww  (ocf::heartbeat:Filesystem):    Stopped
     DrbdMysql  (ocf::linbit:drbd):     FAILED (blocked)[ s-ha-web1 s-ha-web2 ]
     fsDrbdMysql        (ocf::heartbeat:Filesystem):    Stopped
     mysql      (ocf::heartbeat:mysql): Stopped

Failed Actions:
* Drbdwww_monitor_0 on s-ha-web1 'not configured' (6): call=14, status=complete, exitreason='none',
    last-rc-change='Mon May  8 21:58:40 2017', queued=0ms, exec=21ms
* DrbdMysql_stop_0 on s-ha-web1 'not configured' (6): call=23, status=complete, exitreason='none',
    last-rc-change='Mon May  8 21:58:40 2017', queued=0ms, exec=30ms
* Drbdwww_stop_0 on s-ha-web2 'not configured' (6): call=32, status=complete, exitreason='none',
    last-rc-change='Mon May  8 21:58:40 2017', queued=0ms, exec=17ms
* DrbdMysql_stop_0 on s-ha-web2 'not configured' (6): call=31, status=complete, exitreason='none',
    last-rc-change='Mon May  8 21:58:40 2017', queued=0ms, exec=17ms

Here is my pacemaker configuration :

crm configure property stonith-enabled=false
crm configure property no-quorum-policy=ignore

crm configure primitive vip ocf:heartbeat:IPaddr2 params ip=192.168.100.100 cidr_netmask=24 nic="eth1" op monitor interval="30s" timeout="20s"

crm configure primitive Drbdwww ocf:linbit:drbd params drbd_resource="rwww" op monitor interval="30s" role="Slave" op monitor interval="29s" role="Master" 

crm configure primitive fsDrbdwww ocf:heartbeat:Filesystem params device="/dev/drbd0" directory="/var/www/html" fstype="ext4"

crm configure primitive DrbdMysql ocf:linbit:drbd params drbd_resource="rmysql" op monitor interval="30s" role="Slave" op monitor interval="29s" role="Master" 

crm configure primitive fsDrbdMysql ocf:heartbeat:Filesystem params device="/dev/drbd1" directory="/var/lib/mysql_drbd" fstype="ext4"

Can someone help me ?
If you need some more informations, please tell me.

Best Answer

You're missing quite a bit here.

First, you're going to need a master slave resource set for each of your DRBD devices.

Then, you'll probably want to to create groups of resources (fs, ip, service), using colocation and ordering constraints to tell those groups to start only where/after their respective DRBD device has been promoted to master. Resource groups imply colocation and ordering of resources inside the group.

Google should turn up numerous guides on setting up HA LAMP stacks using DRBD and Pacemaker.

EDIT: More information was supplied in the form of an answer... I can get more specific now.

This is what your CIB (pacemaker configuration) should look like:

node 1: s-ha-web1
node 2: s-ha-web2
primitive Drbdwww ocf:linbit:drbd \
    params drbd_resource="rwww" \
    op monitor interval="30s" role="Slave" \
    op monitor interval="29s" role="Master"
primitive DrbdMysql ocf:linbit:drbd \
    params drbd_resource="rmysql" \
    op monitor interval="30s" role="Slave" \
    op monitor interval="29s" role="Master"
primitive fsDrbdwww ocf:heartbeat:Filesystem \
    params device="/dev/drbd0" directory="/var/www/html" fstype="ext4" \
    op monitor interval=30s timeout=30s
primitive fsDrbdMysql ocf:heartbeat:Filesystem \
    params device="/dev/drbd1" directory="/var/lib/mysql_drbd" fstype="ext4" \
    op monitor interval=30s timeout=30s
primitive vipwww ocf:heartbeat:IPaddr2 \
    params ip=192.168.100.100 cidr_netmask=24 nic="eth1" \
    op monitor interval="30s" timeout="20s"
primitive vipmysql ocf:heartbeat:IPaddr2 \
    params ip=192.168.100.101 cidr_netmask=24 nic="eth1" \
    op monitor interval="30s" timeout="20s"
primitive httpd ocf:heartbeat:apache \
    op start interval=0s timeout=40s
    op stop interval=0s timeout=60s
    op monitor interval=20s timeout=20s
primitive mysql ocf:heartbeat:mysql \
    op start interval=0s timeout=120s
    op stop interval=0s timeout=120s
    op monitor interval=20s timeout=30s
group gwww fsDrbdwww vipwww httpd
group gmysql fsDrbdMysql vipmysql mysql
order o_drbdwww-before-gwww inf: ms_drbdwww:promote gwww:start
colocation cl_gwww-with-drbdwww inf: gwww ms_drbdwww:Master
order o_drbdMysql-before-gmysql inf: ms_drbdMysql:promote gmysql:start
colocation cl_gmysql-with-drbdMysql inf: gmysql ms_drbdMysql:Master
ms ms_drbdwww Drbdwww \
    meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
ms ms_drbdMysql DrbdMysql \
    meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
property cib-bootstrap-options: \
    stonith-enabled=false \
    no-quorum-policy=ignore

The failed actions on your DRBD resources likely means you haven't properly setup your DRBD devices. Did you already create the metadata for the devices? If so, did you already force promote one node to Primary in order to start the initial sync? What does the output of cat /proc/drbd look like?