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高可用性集群的从部署到监视完整过程。
13/13 首页 上一页 11 12 13 |