uCosminexus Application Server, Operation, Monitoring, and Linkage Guide
Create the following shell script files to monitor the processes of the Administration Agent and to start and stop the Administration Agent and logical servers:
Use the same shell script file in Application Server of the active node and Application Server of the spare node, and deploy in the same path.
An example of the shell script file for monitoring the processes of the Administration Agent (manager_adminagent_monitor.sh) is as follows:
#!/bin/sh LOGDIR=/home/manager/hamon/log AA=/opt/Cosminexus/manager/bin/adminagent logg() { echo `date '+[%Y/%m/%d %H:%M:%S]'`"[$$]: $1" \ >> ${LOGDIR}/adminagent.log 2>&1 } logg "### $0: started. ###" while true do CHECK=`ps -ef | grep $AA | grep -v grep` if [ "$CHECK" = "" ] then logg "### $0: stop. ###" exit 0 fi sleep 10 done |
An example of the shell script file for starting the Administration Agent and logical servers (manager_adminagent_start.sh) is as follows:
#!/bin/sh LOGDIR=/home/manager/hamon/log SCRIPTDIR=/home/manager/hamon/bin MNGDIR=/opt/Cosminexus/manager logg() { echo `date '+[%Y/%m/%d %H:%M:%S]'`"[$$]: $1" \ >> ${LOGDIR}/adminagent.log 2>&1 } # make adminagent.access.info logg "### $0: make adminagent.access.info ###" echo 172.16.12.30:28080,hostA:20295 > $MNGDIR/tmp/adminagent.access.info # start Administration Agent logg "### $0: starting Administration Agent. ###" $MNGDIR/bin/adminagentctl start if [ $? -eq 0 ] ; then logg "### $0: Administration Agent start normally. ###" else logg "### $0: Administration Agent cannot start. ###" exit 1 fi sleep 10 # start logical server logg "### $0: starting logical servers. ###" $MNGDIR/bin/mngsvrutil -m mnghost:28080 -t lserver1 -s start server $MNGDIR/bin/mngsvrutil -m mnghost:28080 -t lserver2 -s start server $MNGDIR/bin/mngsvrutil -m mnghost:28080 -t lserver3 -s start server exit 0 |
Use the shell script file to create the access information file (/opt/Cosminexus/manager/tmp/adminagent.access.info)#, and to start the Administration Agent and logical servers.
The settings to be specified in the shell script file are as follows:
echo 172.16.12.30:28080,hostA:20295 > $MNGDIR/tmp/adminagent.access.info
<Mng_ip>:<Mng_port>,<AA_host>:<AA_port>
An example of the shell script file for stopping the Administration Agent and logical servers (manager_adminagent_stop.sh) is as follows:
#!/bin/sh LOGDIR=/home/manager/hamon/log MNGDIR=/opt/Cosminexus/manager logg() { echo `date '+[%Y/%m/%d %H:%M:%S]'`"[$$]: $1" \ >> ${LOGDIR}/adminagent.log 2>&1 } # stop logical server logg "### $0: stop logical servers. ###" $MNGDIR/bin/mngsvrutil -m mnghost:28080 -t lserver3 -s stop server $MNGDIR/bin/mngsvrutil -m mnghost:28080 -t lserver2 -s stop server $MNGDIR/bin/mngsvrutil -m mnghost:28080 -t lserver1 -s stop server # stop Administration Agent logg "### $0: stopping Administration Agent. ###" $MNGDIR/bin/adminagentctl stop |
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.