
#
if [ "$2" = "" ]
then
type="xxxx" #invalid option, forces usage message
else
inst=$2 #cache instance to play with
state=$3 #failover or "nothing"
#
basdir=`/usr/bin/ccontrol list $inst | grep -i directory | awk {'print $2'}`
localnode=`uname -a | awk '{print $2}'`
if [ "${basdir}" = "" ]
then
echo "Instance $inst not found"
exit 1
fi
type=$1
fi
#
#See how we were called.
case "$type" in
(start)
# Start daemons.
if [[((-e ${basdir}/mgr/cache.ids) &&("${state}" == "failover" ))]]
then
echo "Removing $basdir/mgr/cache.ids during HA failover"
rm -f $basdir/mgr/cache.ids
fi
echo "Starting Cache-HA inst $inst on $localnode"
ccontrol start $inst quietly
status=$?
case $status in
(1)
echo "...Failed to start"
exit 1
;;
(0)
echo "...Started"
exit 0
esac
;;
(stop)
# Stop daemons.
echo "Stopping Cache-HA inst $inst on $localnode"
ccontrol stop $inst quietly
status=$?
case $status in
(1)
echo "Cache instance $inst failed to stop"
exit 1
;;
(0)
echo "Cache instance $inst stopped"
exit 0
esac
;;
(status)
FIELDWIDTH=2
state=`/usr/bin/ccontrol all | grep -i $inst | awk {'print $1'}`
if [ "$state" = "up" ]
then
exit 0 #cache is up
fi
exit 1 #cache is down or we can't tell
;;
(restart)
$0 stop $2 $3 || :
$0 start $2 $3
;;
8 Caché ECP Clusters on Red Hat Enterprise Linux
Adding Caché to the Cluster Services
Comentarios a estos manuales