标签:proc mha ack data 配置 vtk net -- base64
yum install ipvsadm #安装ipvsadm
ipvsadm -C #清除所有虚拟服务
1.编辑vim /sbin/lvsdr.sh
#!/bin/sh VIP=192.168.248.128 RIP1=192.168.248.130 RIP2=192.168.248.131 /etc/rc.d/init.d/functions case "$1" in start) echo "start LVS of DirectorServer" #set the Virtual IP Address ifconfig ens33:0 $VIP/24 -->注意网卡ens33名称要与本机设备名称相符合 #/sbin/route add -host $VIP dev ens33:0 #Clear IPVS table /sbin/ipvsadm -C #set LVS /sbin/ipvsadm -A -t $VIP:80 -s rr /sbin/ipvsadm -a -t $VIP:80 -r $RIP1:80 -g /sbin/ipvsadm -a -t $VIP:80 -r $RIP2:80 -g #Run LVS /sbin/ipvsadm #end ;; stop) echo "close LVS Directorserver" /sbin/ipvsadm -C ;; *) echo "Usage: $0 {start|stop}" exit 1 esac
chown -R root:root /sbin/lvsdr.sh
chmod -R 777 /sbin/lvsdr.sh
启动服务:
/sbin/lvsdr.sh start
ifconfig ens33:0 192.168.88.250 broadcast 192.168.88.250 netmask 255.255.255.255 up #添加一个ip route add -host 192.168.88.250 dev ens33:0 #添加一条路由,使访问192.168.88.250的时候走ens33:0这个网卡
2.real_server端配置,server1和2的配置相同(可以称为员工)
echo "1">/proc/sys/net/ipv4/conf/lo/arp_ignore echo "2">/proc/sys/net/ipv4/conf/lo/arp_announce echo "1">/proc/sys/net/ipv4/conf/all/arp_ignore echo "2">/proc/sys/net/ipv4/conf/all/arp_announce service httpd restart
lvs-server ifconfig tunl0 192.168.248.128 broadcast 192.168.248.128 netmask 255.255.255.0 up route add -host 192.168.248.128 dev tunl0 ipvsadm -A -t 192.168.248.128:80 -s rr ipvsadm -a -t 192.168.248.128:80 -r 192.168.88.18 -i ipvsadm -a -t 192.168.248.128:80 -r 192.168.88.19 -i
real server ifconfig tunl0 192.168.248.128 netmask 255.255.255.255 broadcast 192.168.248.128 up route add -host 192.168.248.128 dev tunl0 echo "1" >/proc/sys/net/ipv4/conf/tunl0/arp_ignore echo "2" >/proc/sys/net/ipv4/conf/tunl0/arp_announce echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce echo "0" >/proc/sys/net/ipv4/conf/tunl0/rp_filter echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter
标签:proc mha ack data 配置 vtk net -- base64
原文地址:https://www.cnblogs.com/shione/p/12251755.html