1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| #10.0.0.14 关闭arp广播 echo "net.ipv4.conf.lo.arp_ignore = 1" >> /etc/sysctl.conf echo "net.ipv4.conf.lo.arp_announce = 2" >> /etc/sysctl.conf
echo "net.ipv4.conf.all.arp_ignore = 1" >> /etc/sysctl.conf echo "net.ipv4.conf.all.arp_announce = 2" >> /etc/sysctl.conf #10.0.0.14 添加VIP ip a a 10.0.0.200/32 dev lo label lo:1 #10.0.0.11 添加VIP ip a a 10.0.0.200/32 dev lo label lo:1 #10.0.0.11 添加LVS规则 ipvsadm -A -t 10.0.0.200:8080 -s rr ipvsadm -a -t 10.0.0.200:8080 -r 10.0.0.14 -g
ipvsadm-save -n > /etc/sysconfig/ipvsadm
#检查路由和网关
#lvs的服务器可以不配网关,需要把/proc/sys/net/ipv4/conf/all/rp_filter 设置为0,不检查回路
|