首页 > 经验交流

用Heartbeat配置Linux高可用性集群

时间:2009-05-01 22:42:16  作者:chinaitlab  我要投稿
Linux初探欢迎您的投稿,投放方法请点击这里查看,我们会定期赠送精美小礼品给优秀的投稿作者。海纳百川 取则行远!LinuxGoo欢迎您的到来。
Linux下高可用集群方案很多,本文介绍的是性价比比较高的一种: 使用Heartbeat 2.0配置Linux高可用性集群。一、 准备工作你首先需要两台电脑,这两台电脑并不需要有相......

[ 11 ] fping的工作频率。
[ 12 ]→使用fping.monitor脚本。
[ 13 ]→针对语法输入:perldoc Time::Period
[ 14 ]→当节点之一断开时。
[ 15 ]→当节点之一连接时。
[ 16 ]→每小时仅仅发送警报的电子邮件一次。
Vi /etc/services,添加两行:
mon 2583/tcp # MON
mon 2583/udp # MON traps

6 通过手工运行fping.monitor和mail.alert脚本的测试

脚本命令如下:

#/usr/lib/mon/mon.d/fping.monitor clnode1
输出如下:
start time: <current date>
end time : <current date>
duration : 0 seconds

--------------------------------------------------------
reachable hosts rtt
-------------------------------------------------------209.100.100.2 58.10 ms



上面的报告IP地址为209.100.100.2以58.10个秒响应fping。
如果这脚本不适当地工作,你能需要告诉Perl找到fping的工具。编辑fping.monitor文件:
my $CMD = "/usr/local/sbin/fping -e -r $RETRIES -t $TIMEOUT";
要测试电子邮件警报,输入:
#echo "Testing 123" | /usr/lib/mon/alert.d/mail.alert alert@domain.com
alert@domain.com 是电子邮件的发送地址。

7 使用调试方式时开始Mon测试

#/usr/lib/mon/mon -d
正常输出如下:
PID 8211 (clusternodes/cluster-ping-check) exited with [0]
Mon发送的电子邮件警报如下:
Subject: ALERT clusternodes/process-check: localhost:ntpd,ypbind

Summary output : localhost:ntpd,ypbind

Group : clusternodes
Service : process-check
Time noticed : <Time and Date>
Secs until next alert :
Members : localhost

Detailed text (if any) follows:
-------------------------------

localhost:ntpd Count=0 Min=0 Max=0
localhost:ypbind Count=0 Min=0 Max=0


到此为止笔者简单介绍了使用Heartbeat 2.0配置Linux高可用性集群的从部署到监视完整过程。

如果您需转载 用Heartbeat配置Linux高可用性集群,请注明来自LinuxGoo.com,其版权归原作者所有。请广大网友留言时遵纪守法,使用文明用语。如果您在应用中有什么问题,请在下面留言,我们会尽快解答。
来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
栏目热门