[Linux-cluster] determine active or passive node

Jeff Stoner jstoner at opsource.net
Wed Dec 13 01:37:08 UTC 2006


Since Cluster Services requires the init script to have a status
function, just use that in your scripts. I do this with a MySQL backup
script, like this:

/sbin/service mysqld status >/dev/null 2>/dev/null
if test $? -eq 0
then
   # run backup
else
   # MySQL is not running on this server at this time
   echo "MySQL not running on this node."
   exit 0
fi


--Jeff
SME - UNIX
OpSource Inc.

PGP Key ID 0x6CB364CA 

> -----Original Message-----
> I have a cluster (running a db2 service) due for production shortly.
> Certain service related cron jobs need to run only on the active node.
> I'd rather not reinvent the wheel.  Does anyone have any code 
> that checks if the current node is active?  Would you be 
> willing to share it in exchange for karma?




More information about the Linux-cluster mailing list