使用简单的5个步骤设置Web服务器集群

豆豆网   技术应用频道   2007年09月20日    社区交流

内容摘要:使用 Linux Virtual Server 和 Heartbeat v2,分 5 个步骤跨越多个物理或虚拟 Linux® 服务器轻松构建高度可用的 Apache 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

来源:ibm    作者:Eli Dow    责编:豆豆技术应用

正在加载评论...