[lvs-users] Deploy a lvs on only one host

Hatt Tom net.study.sea at gmail.com
Sun Apr 20 03:09:45 BST 2014


   I am trying to construct a lvs on my host to schedule different
process listening on different  tcp port .

Here is the shell to config director :

  8 RIP1=
  9 RIP2=
 10 PORT=8088
 11 #
 12 case "$1" in
 13 start)
 14   /sbin/ifconfig eth0:1 $VIP broadcast $VIP netmask up
 15   /sbin/route add -host $VIP dev eth0:1
 16 # Since this is the Director we must be able to forward packets
 17   echo 1 > /proc/sys/net/ipv4/ip_forward
 18 # Clear all iptables rules.
 19   /sbin/iptables -F
 20 # Reset iptables counters.
 21   /sbin/iptables -Z
 22 # Clear all ipvsadm rules/services.
 23   /sbin/ipvsadm -C
 24 # Add an IP virtual service for VIP
 25 # In this recipe, we will use the round-robin scheduling method.
 26 # In production, however, you should use a weighted, dynamic
scheduling method.
 27   /sbin/ipvsadm -A -t $VIP:8088 -s rr
 28 # Now direct packets for this VIP to
 29 # the real server IP (RIP) inside the cluster
 30   /sbin/ipvsadm -a -t $VIP:8088 -r $RIP1 -g -w 1
 31   /sbin/ipvsadm -a -t $VIP:8088 -r $RIP2 -g -w 2
 32   /bin/touch /var/lock/subsys/ipvsadm &> /dev/null

After I configure the director  , the real server  has not received
any routed packet from director

where haveI token  a mistake?

Best Regards!

More information about the lvs-users mailing list