Mysql高可用一例,代码细观察

0 views
Skip to first unread message

tommy xiao

unread,
Apr 9, 2009, 3:16:49 AM4/9/09
to Coder...@googlegroups.com
Mysql的客户端连接Server,对超时很在意。所以如果想达到好的效果,是出问题就切换。这里有老外出招,使用DNS+Nagios的Event来更新namespace.
这里就涉及到一个mysql的连接状态的问题,从另一条消息看到如下脚本,直接用上就可以。:

#!/bin/ksh

STATUS=$(/usr/bin/echo status | /san/mysql/bin/mysql -u root 2>/dev/null |/usr/bin/grep -c Uptime)

if [ "$STATUS" -eq "1" ]
then
exit 110
else
exit 100
fi





--
tommy xiao

Reply all
Reply to author
Forward
0 new messages