[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ha
Subject:    Re: [Linux-HA] drbd and heartbeat 2
From:       Andreas Kurz <akurz () sms ! at>
Date:       2006-11-30 15:04:16
Message-ID: 456EF2F0.30105 () sms ! at
[Download RAW message or body]

Hello!

Here is a snippet from a running config on one of our clusters. The
heartbeat resource script comes with the drbd installation, the
ocf-script is not yet production ready. I had to tune the "drbddisk"
script a little bit, to try a 'stop' several times like in the 'start'
sequence:

diff drbddisk drbddisk.org
37,45c37
<       # try several times
<         try=6
<       if [ -e /proc/drbd ]; then
<            while true; do
<               $DRBDADM secondary $RES && break
<               let "--try" || exit 20
<               sleep 3
<            done
<       fi
---
>       ! test -e /proc/drbd || exec $DRBDADM secondary $RES

The "local_start_script" of the IPaddr resource checks if the bonding
device is pingable and makes an "ifup bond0" (without that, you end up
with a bonding device without any slave interfaces but with your HA-IP
as an alias) e.g in case someone did an ifdown on that interface.

For drbd recplication between the two servers we use two gb-nics, direct
connected and configured as bonding devices witch load-balancing ... and
as a second heartbeat path .... and we use a stonith device ....

Regards,
Andreas


Jean Chiappini wrote:
> Hello,
> 
> Who had a good configuration file for heartbeat v2 with drbd ? I just
> setup two servers with heartbeat v2 to load balance an IP address, but I
> don't find any solution to load balance the IP and the drdb directory.
> This is my cib.xml file :
> 
> <?xml version="1.0" ?>
> <cib admin_epoch="0" epoch="0" num_updates="0">
>        <configuration>
>                <crm_config>
>                        <cluster_property_set id="cib-bootstrap-options">
>                                <attributes>
>                                        <nvpair
> id="cib-bootstrap-options-symmetric_cluster" name="symmetric_cluster"
> value="true"/>
>                                        <nvpair
> id="cib-bootstrap-options-no_quorum_policy" name="no_quorum_policy"
> value="stop"/>
>                                        <nvpair
> id="cib-bootstrap-options-default_resource_stickiness"
> name="default_resource_stickiness" value="0"/>
>                                        <nvpair
> id="cib-bootstrap-options-default_resource_failure_stickiness"
> name="default_resource_failure_stickiness" value="0"/>
>                                        <nvpair
> id="cib-bootstrap-options-stonith_enabled" name="stonith_enabled"
> value="false"/>
>                                        <nvpair
> id="cib-bootstrap-options-stonith_action" name="stonith_action"
> value="reboot"/>
>                                        <nvpair
> id="cib-bootstrap-options-stop_orphan_resources"
> name="stop_orphan_resources" value="true"/>
>                                        <nvpair
> id="cib-bootstrap-options-stop_orphan_actions"
> name="stop_orphan_actions" value="true"/>
>                                        <nvpair
> id="cib-bootstrap-options-remove_after_stop" name="remove_after_stop"
> value="false"/>
>                                        <nvpair
> id="cib-bootstrap-options-short_resource_names"
> name="short_resource_names" value="true"/>
>                                        <nvpair
> id="cib-bootstrap-options-transition_idle_timeout"
> name="transition_idle_timeout" value="5min"/>
>                                        <nvpair
> id="cib-bootstrap-options-default_action_timeout"
> name="default_action_timeout" value="5s"/>
>                                        <nvpair
> id="cib-bootstrap-options-is_managed_default" name="is_managed_default"
> value="true"/>
>                                </attributes>
>                        </cluster_property_set>
>                </crm_config>
>                <nodes/>
>                <resources>
>                        <primitive class="ocf"
> id="IPaddr_192_168_200_151" provider="heartbeat" type="IPaddr">
>                                <operations>
>                                        <op
> id="IPaddr_192_168_200_151_mon" interval="5s" name="monitor" timeout="5s"/>
>                                </operations>
>                                <instance_attributes
> id="IPaddr_192_168_200_151_inst_attr">
>                                        <attributes>
>                                                <nvpair
> id="IPaddr_192_168_200_151_attr_0" name="ip" value="192.168.200.151"/>
>                                                <nvpair
> id="IPaddr_192_168_200_151_attr_1" name="netmask" value="24"/>
>                                                <nvpair
> id="IPaddr_192_168_200_151_attr_2" name="nic" value="eth0"/>
>                                        </attributes>
>                                </instance_attributes>
>                        </primitive>
>                </resources>
>                <constraints>
>                        <rsc_location
> id="rsc_location_IPaddr_192_168_200_151" rsc="IPaddr_192_168_200_151">
>                                <rule
> id="prefered_location_IPaddr_192_168_200_151" score="100">
>                                        <expression attribute="#uname"
> id="prefered_location_IPaddr_192_168_200_151_expr" operation="eq"
> value="roz1"/>
>                                </rule>
>                        </rsc_location>
>                </constraints>
>        </configuration>
>        <status/>
> </cib>
> 
> 
> Thank you in advance.
> 
> Regards
> 
> Jean
> 
> _______________________________________________
> Linux-HA mailing list
> Linux-HA@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems

["drbd_snippet.xml" (text/xml)]

       <group id="gr_HANFS_01">
         <primitive class="heartbeat" type="drbddisk" \
id="rsc_DRBD_drbd1_uploads_sms">  <instance_attributes \
id="a5da97fc-e1e4-418f-8352-d06359fa5f78">  <attributes>
               <nvpair name="1" value="drbd1_uploads_sms" \
id="d562406b-ecb2-4095-98e4-dfaf7aa22e29"/>  </attributes>
           </instance_attributes>
           <operations>
             <op name="start" on_fail="restart" \
                id="7b477c1e-059a-4974-93e7-e54582443aa3" prereq="fencing" \
                timeout="180s"/>
             <op name="stop" on_fail="fence" \
                id="e1d996d4-f611-4d2a-b759-e48f9e447e58" prereq="fencing" \
                timeout="90s"/>
             <op id="rsc_DRBD_drbd1_uploads_sms_mon" interval="120s" name="monitor" \
timeout="60s" start_delay="60s"/>  </operations>
         </primitive>
         <primitive class="ocf" provider="heartbeat" type="Filesystem" \
id="rsc_FS_HANFS01-sms_at">  <instance_attributes \
id="3506602c-5d1f-4e1e-830a-a37f22a335cd">  <attributes>
               <nvpair name="device" value="/dev/drbd1" \
                id="4397f12d-5e93-40c2-a4ab-d88a9286e99a"/>
               <nvpair name="directory" value="/srv/HANFS01/sms_at" \
                id="875b2d53-0cf7-42c0-8c4d-dd74a6393af9"/>
               <nvpair name="fstype" value="ext3" \
                id="74060dc1-cb63-4124-892b-07d11fbc16e1"/>
               <nvpair name="options" value="noatime" \
id="47979dd0-7813-43ce-bd91-150d095fb9f6"/>  </attributes>
           </instance_attributes>
           <operations>
             <op name="start" on_fail="restart" \
                id="5e8b0e26-2bcf-4c7b-9bf9-9fd1c53975f4" prereq="fencing"/>
             <op name="stop" on_fail="fence" \
                id="b2389e2a-f21a-4081-93b0-ccfae8cbc370" prereq="fencing"/>
             <op id="rsc_FS_HANFS01-sms_at_mon" interval="120s" name="monitor" \
timeout="60s"/>  </operations>
         </primitive>
         <primitive class="ocf" type="IPaddr" provider="heartbeat" id="rsc_IP_HA1">
           <instance_attributes id="2c19ad70-783b-4f8f-b418-5b6e66dce526">
             <attributes>
               <nvpair name="cidr_netmask" value="24" \
                id="69ed064c-3a36-4db6-9420-29eec4c487c8"/>
               <nvpair name="ip" value="192.168.20.172" \
                id="0d469909-1460-47f1-ac97-655273931767"/>
               <nvpair name="nic" value="bond0" \
                id="b039555b-dae0-4b9b-b8a7-65f775fa4776"/>
               <nvpair name="local_start_script" value="/etc/ha.d/check_interface.sh" \
id="2d8eaebf-8a0f-4ff9-8a03-e4c5996534a8"/>  </attributes>
           </instance_attributes>
           <operations>
             <op id="rsc_IP_HA1_mon" interval="5s" name="monitor" timeout="5s"/>
           </operations>
         </primitive>
         <primitive class="ocf" provider="heartbeat" type="MailTo" \
id="rsc_MailAlarm_HANFS_01">  <operations>
             <op name="start" timeout="30s" prereq="nothing" on_fail="ignore" \
                id="ab24da7a-b88f-4808-a3c0-78ecd6c379ab"/>
             <op name="stop" timeout="30s" prereq="nothing" on_fail="ignore" \
id="c0419e90-7e9c-46cc-9ff9-9aa5d3aefb96"/>  </operations>
           <instance_attributes id="5a003049-58c6-401f-b2a4-756c5f33342b">
             <attributes>
               <nvpair name="email" value="xxxxx" \
                id="4d08fd49-e70c-41d9-99bd-980c401f3548"/>
               <nvpair name="subject" value="HANFS01" \
id="aa26acc6-0d87-47e9-95e1-e60b91ee273b"/>  </attributes>
           </instance_attributes>
         </primitive>
       </group>



_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic