使用简单的5个步骤设置Web服务器集群
2007-09-20 10:51:59 来源:WEB开发网我们从 SLES9 系统中获取 ha.cf 文件,并且为 Version 2 添加底部的 3 行(respawn、pingd 和 crm)。如果您拥有现有的 version 1 配置,您也可以选择执行同样的操作。如果您要使用这些指令执行新安装,您可以复制清单 3 并进行修改以适应您的生产环境。
清单 3. /etc/ha.d/ha.cf config 文件样例
# Log to syslog as facility "daemon"
use_logd on
logfacility daemon
# List our cluster members (the realservers)
node litsha22
node litsha23
node litsha21
# Send one heartbeat each second
keepalive 3
# Warn when heartbeats are late
warntime 5
# Declare nodes dead after 10 seconds
deadtime 10
# Keep resources on their "preferred" hosts - needed for active/active
#auto_failback on
# The cluster nodes communicate on their heartbeat lan (.68.*) interfaces
ucast eth1 192.168.68.201
ucast eth1 192.168.68.202
ucast eth1 192.168.68.203
# Failover on network failures
# Make the default gateway on the public interface a node to ping
# (-m) -> For every connected node, add <integer> to the value set
# in the CIB, * Default=1
# (-d) -> How long to wait for no further changes to occur before
# updating the CIB with a changed attribute
# (-a) -> Name of the node attribute to set, * Default=pingd
respawn hacluster /usr/lib/heartbeat/pingd -m 100 -d 5s
# Ping our router to monitor ethernet connectivity
ping litrout71_vip
#Enable version 2 functionality supporting clusters with > 2 nodes
crm yes
更多精彩
赞助商链接