Hi,

I still have trouble setting up DRBD v8. I'm not sure if it is related
to the OCF bug found by Marc Cousin. I think it has something to do with
my constraints not working properly.

I have one resource group which should start my services in the
following order: set IP adress, mount DRBD Filesystem, start webservices
and so on (the order in my CIB is currently mixed up and I can't seem to
change it via the GUI but I will work on that later, right now the
Filesystem does NOT need to be mounted for any of the other services but
later on it will need to be).

Then I have created my Master / Slave resource for DRBD which I could
not add to the group. Afaik a M/S resource can not be part of a group.

Now I need a constraint that the resource group runs on the same node
which is the DRBD master. I tried it with the setup found in Dr.
Schwartzkopffs book but I could not get it to work.

Maybe it does not work because I'm using the resource to mount the
filesystem inside the resource group? Do I need to have a single
resource for the filesystem and then add a 2nd order constraints to
start the group after the filesystem?

Right now it does not even mount the filesystem anymore - without any
constraints I at least got it working once (was a 50:50 chance,
depending which node is currently the master).

I have attached my current CIB.

Thanks in advance for your help,

Tobias


 <resources>
   <group id="nagios">
     <meta_attributes id="nagios_meta_attrs">
       <attributes>
         <nvpair name="target_role" id="nagios_metaattr_target_role" 
value="started"/>
         <nvpair id="nagios_metaattr_restart_type" name="restart_type" 
value="ignore"/>
         <nvpair id="nagios_metaattr_collocated" name="collocated" 
value="true"/>
         <nvpair id="nagios_metaattr_ordered" name="ordered" value="true"/>
         <nvpair id="nagios_metaattr_multiple_active" name="multiple_active" 
value="stop_start"/>
       </attributes>
     </meta_attributes>
     <primitive id="httpd" class="lsb" type="httpd" provider="heartbeat">
       <operations>
         <op id="httpd_monitor" name="status" timeout="15" disabled="false" 
role="Started" prereq="quorum" on_fail="restart" interval="30" 
start_delay="60"/>
       </operations>
     </primitive>
     <primitive class="ocf" type="IPaddr2" provider="heartbeat" id="nagios-vip">
       <instance_attributes id="nagios-vip_instance_attrs">
         <attributes>
           <nvpair id="d822bc8a-45dd-447b-9303-76c517f7dd6f" name="ip" 
value="192.168.1.140"/>
         </attributes>
       </instance_attributes>
       <meta_attributes id="nagios-vip_meta_attrs">
         <attributes/>
       </meta_attributes>
     </primitive>
     <primitive id="nagios-core" class="lsb" type="nagios" provider="heartbeat">
       <operations>
         <op id="nagios_monitor" name="status" interval="30" timeout="15" 
start_delay="60" disabled="false" role="Started" prereq="quorum" 
on_fail="restart"/>
       </operations>
     </primitive>
     <primitive id="mysql" class="ocf" type="mysql" provider="heartbeat">
       <instance_attributes id="mysql_instance_attrs">
         <attributes>
           <nvpair id="76603ba6-32fe-476c-8342-61da22fa4488" name="config" 
value="/etc/my.cnf"/>
           <nvpair id="e9df5780-9447-41d1-817d-aeeec8c23255" name="pid" 
value="/var/run/mysql/mysqld.pid"/>
           <nvpair id="656d98e4-5333-4324-b18c-82ca82153825" name="socket" 
value="/var/lib/mysql/mysql.sock"/>
           <nvpair id="75448a03-3842-4ba3-aaa5-8f812197eb05" name="binary" 
value="/usr/bin/mysqld_safe"/>
           <nvpair id="69b3d3ee-8505-4b74-a91c-75efcc6e2286" name="log" 
value="/var/log/mysqld.log"/>
         </attributes>
       </instance_attributes>
     </primitive>
     <primitive id="drbd_fs" class="ocf" type="Filesystem" provider="heartbeat">
       <instance_attributes id="drbd_fs_instance_attrs">
         <attributes>
           <nvpair id="1a23326f-86aa-44d9-ac40-2a8f01ad8b01" name="device" 
value="/dev/drbd0"/>
           <nvpair id="32271174-c25f-4703-bc1a-544638434579" name="directory" 
value="/drbd"/>
           <nvpair id="b00e0e13-a882-42aa-ac02-c98f9f977704" name="fstype" 
value="ext3"/>
         </attributes>
       </instance_attributes>
       <meta_attributes id="drbd_fs_meta_attrs">
         <attributes/>
       </meta_attributes>
     </primitive>
   </group>
   <master_slave id="ms_drbd">
     <meta_attributes id="ms_drbd_meta_attrs">
       <attributes>
         <nvpair id="ms_drbd_metaattr_clone_max" name="clone_max" value="2"/>
         <nvpair id="ms_drbd_metaattr_clone_node_max" name="clone_node_max" 
value="1"/>
         <nvpair id="ms_drbd_metaattr_master_max" name="master_max" value="1"/>
         <nvpair id="ms_drbd_metaattr_master_node_max" name="master_node_max" 
value="1"/>
         <nvpair id="ms_drbd_metaattr_notify" name="notify" value="true"/>
         <nvpair id="ms_drbd_metaattr_globally_unique" name="globally_unique" 
value="false"/>
         <nvpair id="ms_drbd_metaattr_target_role" name="target_role" 
value="started"/>
       </attributes>
     </meta_attributes>
     <primitive id="drbd" class="ocf" type="drbd" provider="heartbeat">
       <instance_attributes id="drbd_instance_attrs">
         <attributes>
           <nvpair id="5ce16970-b3f3-4658-8c3d-15ce7a304434" 
name="drbd_resource" value="r0"/>
           <nvpair id="b7990ad7-99ec-4c0d-87c8-62248b147102" 
name="clone_node_max" value="1"/>
           <nvpair id="c506f2da-fa3d-49fd-9ddc-1b67f06562f7" name="master_max" 
value="1"/>
           <nvpair id="355a9e63-b37b-4e69-9a52-b2648df2e47b" 
name="master_node_max" value="1"/>
           <nvpair id="19777e90-b0cc-4d27-8254-34fde48e10ba" name="drbdconf" 
value="/etc/drbd.conf"/>
           <nvpair id="c185261b-dc3c-41b1-a9f8-480352793f3e" name="clone_max" 
value="2"/>
         </attributes>
       </instance_attributes>
     </primitive>
   </master_slave>
 </resources>

 <constraints>
   <rsc_location id="cli-prefer-nagios" rsc="nagios">
     <rule id="prefered_cli-prefer-nagios" score="INFINITY">
       <expression attribute="#uname" id="f9113f3e-4f24-491c-8136-21f449633810" 
operation="eq" value="node01"/>
     </rule>
   </rsc_location>
   <rsc_order id="order_drbd_filesys" from="drbd_fs" action="start" 
to="ms_drbd" to_action="promote"/>
   <rsc_colocation id="colocation_drbd_filesys" to="ms_drbd" to_role="master" 
from="drbd_fs" score="INFINITY"/>
 </constraints>

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to