Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
Heartbeat.
Browse files Browse the repository at this point in the history
  • Loading branch information
gslin committed Aug 22, 2015
1 parent d1bc006 commit 7df7d86
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
3 changes: 3 additions & 0 deletions heartbeat/authkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
auth 1
1 md5 abcefghijklmnopqrstuvwxyz
11 changes: 11 additions & 0 deletions heartbeat/ha.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
logfile /var/log/ha.log
keepalive 2
deadtime 10
warntime 5
initdead 20
udpport 694
auto_failback off
ucast eth1 192.168.50.102
node db-drbd-1
node db-drbd-2
2 changes: 2 additions & 0 deletions heartbeat/haresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#
db-drbd-1 MailTo::me+drbdfailover@gmail.com::HeartbeatFailover_db-drbd-float drbddisk::r0 Filesystem::/dev/drbd0::/srv::ext4::noatime,nodiratime mysql 192.168.50.103
37 changes: 37 additions & 0 deletions heartbeat/resource.d/mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
#
# This script is inteded to be used as resource script by heartbeat
#
# Mar 2006 by Monty Taylor
#
###

. /etc/ha.d/shellfuncs

case "$1" in
start)
res=`/etc/init.d/mysql start`
ret=$?
ha_log $res
exit $ret
;;
stop)
res=`/etc/init.d/mysql stop`
ret=$?
ha_log $res
exit $ret
;;
status)
if [[ `ps -ef | grep '[m]ysqld'` > 1 ]] ; then
echo "running"
else
echo "stopped"
fi
;;
*)
echo "Usage: mysql {start|stop|status}"
exit 1
;;
esac

exit 0

0 comments on commit 7df7d86

Please sign in to comment.