标签:lvs dr
三台服务器
Real server 1: 10.10.10.51
Real server 2: 10.10.10.52
LVS Directory: 10.10.10.53
VIP: 10.10.10.111
全部服务器关闭selinux 和 iptables
Real server 1
yum install httpd -y echo "Real Server 1" > /var/www/html/index.html service httpd start echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce ifconfig lo:1 10.10.10.111/32 up
Real server 2
yum install httpd -y echo "Real Server 2" > /var/www/html/index.html service httpd start echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce ifconfig lo:1 10.10.10.111/32 up
Director
yum install ipvsadm -y ifconfig eth0:1 10.10.10.111/32 up ipvsadm -A -t 10.10.10.111:80 -s rr ipvsadm -a -t 10.10.10.111:80 -r 10.10.10.51 -g ipvsadm -a -t 10.10.10.111:80 -r 10.10.10.52 -g
浏览器打开http://10.10.10.111,按CRTL+F5刷新,查看效果
本文出自 “每天进步一点” 博客,请务必保留此出处http://1step.blog.51cto.com/1160799/1763710
标签:lvs dr
原文地址:http://1step.blog.51cto.com/1160799/1763710