2

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.

2

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?

0

thanks for answering. I created a group named haweb with vip Drbdwww DrbdMysql fsDrbdwww fsDrbdMysql apache2 mysql, but when I wanted to create a master slave resource, I had an error because Drbdwww and DrbdMysql were child of the haweb group. I deleted the haweb group and create master slave resources with

ms ms_drbdMysql DrbdMysql \
        meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
ms ms_drbdwww Drbdwww \
        meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true

But I still have FAILED (blocked) :

 Master/Slave Set: ms_drbdwww [Drbdwww]
     Drbdwww    (ocf::linbit:drbd):     FAILED s-ha-web2 (blocked)
 Master/Slave Set: ms_drbdMysql [DrbdMysql]
     DrbdMysql  (ocf::linbit:drbd):     FAILED s-ha-web2 (blocked)
* fsDrbdwww_start_0 on s-ha-web1 'unknown error' (1): call=14, status=complete, exitreason='Couldn't mount filesystem /dev/drbd0 on /var/www/html',
    last-rc-change='Mon May  8 23:24:04 2017', queued=0ms, exec=17ms
* fsDrbdMysql_start_0 on s-ha-web1 'unknown error' (1): call=21, status=complete, exitreason='Couldn't mount filesystem /dev/drbd1 on /var/lib/mysql_drbd',
    last-rc-change='Mon May  8 23:24:04 2017', queued=0ms, exec=17ms

And now I have some resources on server 1 and others on server 2 :( I will search some more information on colocation and groups ! thanks

EDIT : I don't know how to create my goup(s) and colocation(s) Do I have to create 2 VIP ? 1 for apache + DRBD-WWW and 1 for mysql and DRBD-mysql ?

  • I will edit my answer to be more specific now that you've supplied this information. Standby. – Matt Kereczman May 9 '17 at 14:40
  • 1
    You don't need two VIPs, but it's likely a good idea – Matt Kereczman May 9 '17 at 14:40
  • @MattKereczman I am getting same error. – Chaminda Bandara May 18 at 15:02
  • @anakin.wow Do you found a solution ? – Chaminda Bandara May 18 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.