Once I wrote this simple script to simplify start/stop/move and other
operations on resources:

#!/bin/sh
#
# Description:  A simple script to simplify some Linux-HA commands
#
#
# Author:       Serge Dubrouski
#


usage() {
   echo "Usage: hares -[start|stop|manage|unmanage|move|unmove]
resource [-to node]"
   exit 1
}


moveResource() {
   if [ $# -lt 2 ] || [ $1 != "-to" ]
   then
       usage
   fi

   echo "Moving $res to $2"

   crm_resource -M -r $res -H $2
}


if [ $# -lt 2 ]
then
   usage
fi

case $1 in
   -[sS][tT][oO][pP])
                   echo "Trying to stop resource $2"
                   cibadmin -M -o resources -X "<nvpair
id=\"${2}_role\" value=\"Stopped\"/>"
                   break;;
   -[sS][tT][aA][rR][tT])
                   echo "Trying to start resource $2"
                   cibadmin -M -o resources -X "<nvpair
id=\"${2}_role\" value=\"Started\"/>"
                   break;;
   -[mM][aA][nN][aA][gG][eE])
                   echo "Putting $2 into MANAGED state"
                   crm_resource -p is_managed -r $2 -t primitive -v true
                   break;;
   -[uU][nN][mM][aA][nN][aA][gG][eE] )
                   echo "Putting $2 into UNMANAGED state"
                   crm_resource -p is_managed -r $2 -t primitive -v false
                   break;;
   -[mM][oO][vV][eE] )
                   res=$2
                   shift; shift
                   moveResource $*
                   break;;      
   -[uU][nN][mM][oO][vV][eE])
                   echo "UnMove $2"
                   crm_resource -U -r $2
                   break;;
   * ) usage;;
esac



On 4/30/07, Tao Yu <[EMAIL PROTECTED]> wrote:
Hi all,

I am a new user of heartbeat.

I configure a cluster with two nodes, and I want to move resource from
current running node to the other one. From the mgmt_common.h, I can not
figure out which message I should send to the mgmt module so I do the
following:
     1. send "standby on" to current running node (node1)
     2. wait for some time, then send "standby off" to node1, to make sure
it could fail over back.

Is there a single command can having this done?

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

_______________________________________________
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