Open GoogleCodeExporter opened 9 years ago
For checking MHA status codes, there is a utility script masterha_check_status.
I think this will help.
$ masterha_check_status --conf=mha_test.cnf
mha_test is stopped(2:NOT_RUNNING).
$ echo ?
2
Original comment by Yoshinor...@gmail.com
on 5 Dec 2012 at 12:59
You can run it with a guardian process like supervisor or cluster like
pacemaker to start it automatically.
Original comment by m.je...@gmail.com
on 5 Feb 2013 at 8:05
Very good project .. thanks a lot
Created a init scrip for ubuntu and works well ...
###### Put this under /etc/init.d/ ########
####### Name it as mhamanager ( Any name is ok :-) ##########
###### Grant the execution privilege ##############
####### Script Starts #################
#! /bin/sh
. /lib/lsb/init-functions
name="mhamanager"
#mhamanager_conf=/etc/app1.cnf Configuration file for the MHA MANAGER
#mhamanager_log=/var/log/masterha/app1/app1.log Log file location for the MHA
manager
pid_file="/var/run/$name.pid"
start () {
command_ls=`nohup masterha_manager --conf=/etc/app1.cnf < /dev/null >>
/var/log/masterha/app1/app1.log 2>&1 &`
ps -ef | grep -i "masterha_manager" | grep -v grep | awk '{print $2}' >
$pid_file
log_daemon_msg "Starting $name"
}
stop () {
log_daemon_msg "Stopping $name"
start-stop-daemon --stop --quiet --oknodo --pidfile "$pid_file"
}
status () {
log_daemon_msg "Status of $name"
status_of_proc -p $pid_file "$name"
}
case $1 in
start)
if status; then exit 0; fi
start
status && exit 0 || exit $?
;;
stop)
stop
;;
reload)
stop
start
;;
restart)
stop
start
;;
status)
status && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
;;
esac
exit 0
######### Script Ends ################
Original comment by sj...@win2ix.ca
on 25 Feb 2013 at 11:19
Original issue reported on code.google.com by
obric...@balakam.com
on 4 Dec 2012 at 2:04