[ClusterLabs] DRBD: both nodes stuck in secondary mode

Dimitri Maziuk dmaziuk at bmrb.wisc.edu
Tue Jun 14 17:14:42 UTC 2016


On 06/13/2016 10:13 PM, Kevin THIERRY wrote:
> Hello,
> 
> I've been trying to setup pacemaker to get a HA system for a web
> application but I am having a hard time with DRBD. 

This worked for me:

First, make sure your drbd resource is consistent/up to date and
finished syncing. IME initial setup never worked wile it's syncing. I
normally do mkfs on it then, too.

Second, write it to file then push the whole file in one transaction.
Otherwise it'll put drbd-master and drbd-fs on the different nodes and
you'll have much fun unfscking that.

pcs cluster cib drbd_cib
pcs -f drbd_cib resource create drbd_storage ocf:linbit:drbd \
 drbd_resource=raid op monitor interval=29s role="Master" \
 op monitor interval=31s role="Slave"
pcs -f drbd_cib resource master drbd_storage_sync drbd_storage \
 master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
pcs -f drbd_cib resource create drbd_filesystem Filesystem \
 device="/dev/drbd0" directory="/raid" fstype="ext4"
pcs -f drbd_cib constraint colocation add drbd_filesystem \
 drbd_storage_sync INFINITY with-rsc-role=Master
pcs -f drbd_cib constraint order promote drbd_storage_sync then \
 start drbd_filesystem
pcs -f drbd_cib constraint location drbd_filesystem prefers \
 <YOUR PRIMARY NODE>=INFINITY
pcs -f drbd_cib constraint colocation add drbd_filesystem floating_ip \
 INFINITY
pcs -f drbd_cib constraint order drbd_filesystem then floating_ip
pcs cluster cib-push drbd_cib

-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: OpenPGP digital signature
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20160614/15d33be7/attachment-0004.sig>


More information about the Users mailing list