标签:linux lvs
1.测试环境
操作系统:CentOS6.5
director:
eth0,VIP:172.16.100.1
eth1,DIP:192.168.220.110(hostonly)
realserver1:192.168.220.111(hostonly)
realserver2:192.168.220.112(hostonly)
2.realserver配置
1).安装需要配置成集群服务的服务
2).配置realserver默认网关指向DIP
3.director安装与配置
1).安装ipvsadm
yum install ipvsadm -y
2).打开网卡间转发
echo 1 > /proc/sys/net/ipv4/ip_forward
3).添加ipvs规则
ipvsadm -A -t 172.16.100.1:80 -s rr #添加集群服务 ipvsadm -a -t 172.16.100.1:80 -r 192.168.220.111 -m -w 2 #添加realserver ipvsadm -a -t 172.16.100.1:80 -r 192.168.220.112 -m -w 3
注:在实际环境中各节点的时间应该同步。
标签:linux lvs
原文地址:http://wangyongbin.blog.51cto.com/8964308/1691674