Hi, On Mon, Feb 21, 2011 at 05:44:34PM +0000, Brett Delle Grazie wrote: > Hi, > > If I have two DRBD resources: > resourceA > resourceB > > What's the best way to configure the constraints in pacemaker so that > a tomcat resource, which serves both of them when mounted, > will not be started unless they are both present? My current > configuration (below) fails to migrate correctly when drbd_B fails due > to network glitch > and tomcat fails to stop. In this case, the demote on drbd_B fails > because the directory is still mounted and I end up with a split brain > scenario. Basically I want to force drbd_A and drbd_B to be master on > the same system. > > Currently I have: > node nodeA > node nodeB > > primitive drbd_A ocf:linbit:drbd \ > params drbd_resource="A" \ > op start interval="0" timeout="240" \ > op stop interval="0" timeout="100" \ > op monitor interval="30" > primitive drbd_B ocf:linbit:drbd \ > params drbd_resource="B" \ > op start interval="0" timeout="240" \ > op stop interval="0" timeout="100" \ > op monitor interval="30" > > primitive fs_A ocf:heartbeat:Filesystem \ > params device="/dev/drbd/by-res/A" directory="/mnt/A" > fstype="ext3" options="defaults,noatime" \ > op start interval="0" timeout="60" \ > op stop interval="0" timeout="60" \ > op monitor interval="60" timeout="40" depth="0" > primitive fs_B ocf:heartbeat:Filesystem \ > params device="/dev/drbd/by-res/B" directory="/mnt/B" > fstype="ext3" options="defaults,noatime" \ > op start interval="0" timeout="60" \ > op stop interval="0" timeout="60" \ > op monitor interval="60" timeout="40" depth="0" > > primitive tomcat_tc1 ocf:heartbeat:tomcat \ > params tomcat_user="tomcat" catalina_home="/opt/tomcat6" > catalina_base="/home/tomcat/tc1" > catalina_pid="/home/tomcat/tc1/temp/tomcat.pid" > catalina_rotate_log="NO" script_log="/home/tomcat/tc1/logs/tc1.log" > statusurl="http://localhost/manager/serverinfo" > java_home="/usr/lib/jvm/java" \ > op start interval="0" timeout="60" \ > op stop interval="0" timeout="20" \ > op monitor interval="60" timeout="30" start-delay="60" > primitive vip_1 ocf:heartbeat:IPaddr2 \ > params ip="10.xx,xx,xx" nic="bond0" iflabel="3" \ > op monitor interval="10" timeout="20" > group grp_1 fs_A fs_B vip_1 tomcat_tc1 > > ms ms_drbd_A drbd_A \ > meta master-max="1" master-node-max="1" clone-max="2" > clone-node-max="1" notify="true" > ms ms_drbd_B drbd_B \ > meta master-max="1" master-node-max="1" clone-max="2" > clone-node-max="1" notify="true" > > location loc_ms_drbd_A ms_drbd_A 100: nodeA > location loc_ms_drbd_B ms_drbd_B 100: nodeA
You'd want to add $role=Master in these two. You could also collocate them: colocation two_drbd inf: ms_drbd_A:Master ms_drbd_B:Master > colocation A_on_drbdA inf: grp_1 ms_drbd_A:Master > colocation B_on_drbdB inf: grp_1 ms_drbd_B:Master > > order A_after_drbdA inf: ms_drbd_A:promote grp_1:start The order for _B missing? > Is there a better way to configure this? Otherwise, it seems fine to me. One alternative is to put the two drbd resources in a group then make a m/s resource of that group: group drbd_AB drbd_A drbd_B ms ms_drbd drbd_AB colocation tomcat_on_drbd inf: grp_1 ms_drbd:Master order tomcat_after_drbd inf: ms_drbd:promote grp_1 But in that case the two drbd will start sequentially. Thanks, Dejan > Thanks for any help /pointers. > > -- > Best Regards, > > Brett Delle Grazie > > _______________________________________________ > Pacemaker mailing list: Pacemaker@oss.clusterlabs.org > http://oss.clusterlabs.org/mailman/listinfo/pacemaker > > Project Home: http://www.clusterlabs.org > Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf > Bugs: > http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker _______________________________________________ Pacemaker mailing list: Pacemaker@oss.clusterlabs.org http://oss.clusterlabs.org/mailman/listinfo/pacemaker Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker