LVS DR脚本 解析

vip.sh

#!/bin/bash
ifconfig eth0: 192.168.2.240 broadcast 192.168.2.240 netmask 255.255.255.255 up
route add -host 192.168.2.240 dev eth0:
ipvsadm -C
ipvsadm -A -t 192.168.2.240: -s rr -p
ipvsadm -a -t 192.168.2.240: -r 192.168.2.212 -g
ipvsadm -a -t 192.168.2.240: -r 192.168.2.213 -g
ipvsadm

LVS.sh

#!/bin/bash
ifconfig lo: 192.168.2.240 broadcast 192.168.2.240 netmask 255.255.255.255 up
route add -host 192.168.2.240 dev lo:
echo "" > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo "" > /proc/sys/net/ipv4/conf/lo/arp_announce echo "" > /proc/sys/net/ipv4/conf/all/arp_ignore
echo "" > /proc/sys/net/ipv4/conf/all/arp_announce

ipvsadm -L -n     #处理

上一篇:Win+R运行自定义程序应该这样玩


下一篇:Python学习之路——Day01