[Linux-HA] resource group switch

Andrew Beekhof beekhof at gmail.com
Thu Oct 13 01:37:58 MDT 2005


People running from CVS can now use the crm_resource CLI to do this.

The relevant commands are -M (to move it) and -U (to put it back again).
For more details: crm_resource --help

Andrew

On 9/22/05, Peter Kruse <pk at q-leap.com> wrote:
> Hello,
>
> Sir Alec wrote:
> >
> > I am quite happily testing around with your 2.0.1 version of heartbeat;
> > what I could not find so far in the documentation is a description of
> > how to perform not only node failovers but also resource group switches
> > from one cluster node to another one.
> > Do you have a link for me?!
> >
>
> this is how I do it at the moment:
>
> ===========================8<====================================
> #!/bin/bash
>
> cibadmin=/usr/lib/heartbeat/cibadmin
>
> function get_constraint() {
>      local resgroup="$1"
>      local nodename="$2"
>      local score="$3"
>      cat <<EOF
>      <rsc_location id="run_$resgroup.$nodename" rsc="$resgroup">
>         <rule id="pref_run_$resgroup.$nodename" score="$score">
>             <expression attribute="#uname" operation="eq" value="$nodename"/>
>         </rule>
>      </rsc_location>
> EOF
> }
>
> function move_resource_group() {
>      local rg="$1"
>      local dest="$2"
>      local xml=$(get_constraint $rg $dest INFINITY)
>      ${cibadmin} -o constraint -C -X "$xml"
>      sleep 60
>      $cibadmin  -o constraint -D -X "$xml"
> }
>
> ===========================8<====================================
>
> then run `move_resource_group {groupname} {hostname}'
>
> the `sleep 60' is to ensure that the constraint is removed
> _after_ the resource group is at its destination.
> Andrew suggested to add a time-constraint so that it's
> only valid for a certain time.
>
> Regards,
>
>         Peter
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>



More information about the Linux-HA mailing list