Linux Ldirectord 使用

Linux Ldirectord 使用

注:ldirectord 是一个perl脚本,因此不用安装Heartbeat也是可以使用的,如将Heartbeat中的ldirectord单独copy出来,放到一个新的系统里,只需要yum install 一些perl依赖库即可使用

 

1. 在安装好 Heartbeat 后,便会在 xxx/sbin/ 目录下生成 ldirectord 可执行文件。

2. 检测其是否可用,./ldirectord -h ,如果没有安装过Perl 依赖的模块,则肯定是会出错的。

 

 

perl-Socket6-0.19-3.fc6.i386.rpm 

perl-IO-Socket-INET6-2.51-2.fc6.noarch.rpm 

perl-Email-Date-Format-1.002-1.el5.rf.noarch.rpm
perl-TimeDate-1.20-1.el5.rfx.noarch.rpm 
perl-Pod-Escapes-1.04-5.el5.noarch.rpm 
perl-Pod-Simple-3.04-3.el5.noarch.rpm
perl-Test-Pod-1.26-2.el5.noarch.rpm 
perl-MailTools-2.06-1.el5.rf.noarch.rpm 

 

这些包都可以使用 yum 来安装,不然一个个去下载,然后rpm -ivh 来安装太繁琐。

yum install perl-Socket6

yum install perl-IO-Socket-INET6

yum install perl-Email-Date-Format

yum install perl-TimeDate

yum install perl-Pod-Escapes

yum install perl-Pod-Simple

yum install perl-Test-Pod

yum install perl-MailTools

 

yum install -y perl-Socket6 perl-IO-Socket-INET6 perl-Email-Date-Format perl-TimeDate perl-Pod-Escapes perl-Pod-Simple perl-Test-Pod perl-MailTools

 

安装好后,再运行,显示帮助信息,则证明OK了。


可能出现的问题:

 


http://stackoverflow.com/questions/20089813/bash-cpan-command-not-found

 

 

1. ldirectord 默认查找路径跟安装时指定的prefix有关,如: --prefix=/usr/local/heartbeat,则ldirectord conf路径为 /usr/local/heartbeat/etc/ha.d/conf/

 

configuration 模版:

checktimeout=20

checkinterval=5

autoreload=yes

quiescent=no

logfile="info"

virtual=192.168.1.136:80

     real=192.168.1.105:80 gate 1 ".healthcheck.html", "OKAY"

     real=192.168.1.107:80 gate 1 ".healthcheck.html", "OKAY"

     real=192.168.1.148:80 gate 1 ".healthcheck.html", "OKAY"

     service=http

     checkport=80

     protocol=tcp

     scheduler=wrr

     checktype=negotiate

     fallback=127.0.0.1

 

注意:在virtual行后面的行必须缩进4个空格或一个tab字符进行标记。

如果不空行,会报 Configuration Error,如:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值