分类: 系统运维
2008-09-26 15:22:18
master 服务器配置
1.hosts配置
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.1.217 node01
192.168.1.217 HA01
192.168.1.216 HA02
192.168.1.216 node02 HA02
2.主机名配置
[root@node01 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=node01
3.到/usr/share/doc/heartbeat-2.1.3/复制
ha.cf haresoure authkeys 三个文件到 /etc/ha.d/目录下面
更改目录文件权限 chmod 600 /etc/ha.d/authkeys
4.配置ha相关配置
authkeys配置
[root@node01 ha.d]# grep -v '#' authkeys
auth 1
1 crc
ha.cf配置
[root@node01 ha.d]# grep -v '#' ha.cf
debugfile /var/log/ha-debug
logfacility local0
auto_failback on
keepalive 2
deadtime 10
initdead 120
udpport 694
bcast eth1
node node01
node node02
haresources 配置
[root@node01 ha.d]# grep -v '#' haresources
node01 192.168.1.83
五.开启转发功能
echo "1" > /proc/sys/net/ipv4/ip_forward
六.防火墙配置,充许UPD 694端口通过
七.ipvsadm 配置
[root@node01 ha.d]# cat /etc/
Display all 233 possibilities? (y or n)
[root@node01 ha.d]# cat /etc/sysconfig/ipvsadm
-A -t 192.168.1.83:80 -s rr (192.168.1.83是虚拟IP)
-a -t 192.168.1.83:80 -r 192.168.1.80:80 -g(192.168.1.80是实际应用的服务器)
-a -t 192.168.1.83:80 -r 192.168.1.81:80 -g
从服务器跟主服务器配置相同,
realserver配置
DEVICE=lo:0
IPADDR=192.168.1.83 虚拟IP地址
NETMASK=255.255.255.255
BROADCAST=192.168.1.255
ONBOOT=yes
ARP=no