LVS-DR
配置好yum源后就可以安装组件
在direct上安装ipvsadm
[root@example]#yum -y install ipvsadm
在realserver上安装httpd,两个realserver服务器上都要安装
[root@example]#yum -y install httpd
然后在realserver上编辑/var/www/http目录下的文件
在realserver1上
[root@example]#vi index.html
RS1
在realserver2上
[root@example]#index.html
RS2
在RealServer1和RealServer2上启动HTTPD服务
[root@example]#server httpd start
在DR上
[root@example]#ipconfig etho0:1 172.16.1.200 broadcast 172.16.1.200 netmask 255.255.255.255
[root@example]#route add -host 172.16.1.200 dev eth0:1
[root@example]#ipvsadm -A -t 172.16.1.200:80 -s -wls
[root@example]#ipvsadm -a -t 172.16.1.200:80 -g -r 172.16.1.1 -w 1
[root@example]#ipvsadm -a -t 172.16.1.200:80 -g -r 172.16.1.2 -w 2
[root@example]#ipvsadm -L -n
[root@example]#service ipvsadm save
在RS1上
[root@example]#echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
[root@example]#echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
[root@example]#echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
[root@example]#echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
[root@example]#ifconfig lo:0 172.16.1.200 netmask 255.255.255.255 broadcast 172.16.1.200 up
[root@example]#route add -host 172.16.1.200 dev lo:0
在RS2上
[root@example]#echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
[root@example]#echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
[root@example]#echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
[root@example]#echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
[root@example]#ifconfig lo:0 172.16.1.200 netmask 255.255.255.255 broadcast 172.16.1.200 up
[root@example]#route add -host 172.16.1.200 dev lo:0
配置好后客户端验证
版权声明:本文为博主原创文章,未经博主允许不得转载。