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

Commit

Permalink
Import mysql-heartbeat.
Browse files Browse the repository at this point in the history
  • Loading branch information
gslin committed Aug 22, 2015
1 parent aea9b15 commit 2f807aa
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions mysql-heartbeat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

# 沒有 my.cnf 的時候就不要檢查
if [ ! -r /etc/mysql/my.cnf ]; then
exit
fi

# 沒有 heartbeat 的時候就不要檢查
if [ ! -r /etc/ha.d/ha.cf ]; then
exit
fi

CL="$(/usr/bin/cl_status rscstatus 2>&1)"

# DRBD 中只需要處理當 Heartbeat 確定拿到資源,但 mysql 沒起來的 case

if /sbin/ifconfig -s | /usr/bin/awk '{print $1}' | /bin/grep : > /dev/null 2>&1; then
if ! /bin/ps -U mysql | /bin/grep mysqld > /dev/null 2>&1; then
/usr/share/heartbeat/hb_standby > /dev/null 2>&1
fi
fi

0 comments on commit 2f807aa

Please sign in to comment.