LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] 2 IPs routing to same servers

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] 2 IPs routing to same servers
From: Alan Morais <alan.morais@xxxxxxxxxxxxx>
Date: Wed, 3 Oct 2012 14:47:19 -0300
Hello all!

it has been a 10 months I've using LVS, and i have no problems, but
recently we have decided to change web-servers in our cluster from apache
to nginx, and we want to use a second ip address, sending to same backends
( for compatibility for non SNI browsers ).

the issue, is when i configure a second VIP on backend, ldirectord cannot
check if the backend is alive, and purge it.

i tried to duplicate configuration with new vip, but not worked, apparently
a second lo interface on backend server broke
i want to know what is the best way to work with 2 ips

my configuration:

on LB-server

lb-server:/etc/ha.d# cat ldirectord.cf
checktimeout=4
checkinterval=2
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=no
#fork=yes

#FOR HTTP
virtual=1.1.1.1:80
        real=1.1.2.1:80 gate
        real=1.1.2.2:80 gate
        real=1.1.2.3:80 gate
        real=1.1.2.4:80 gate
        service=http
        scheduler=wlc
        protocol=tcp
        checktype=connect
        persistent=300

#FOR HTTPS
###Un-comment this part if you will use HTTPS
virtual=1.1.1.1:443
        real=1.1.2.1:443 gate
        real=1.1.2.2:443 gate
        real=1.1.2.3:443 gate
        real=1.1.2.4:443 gate
        service=https
        virtualhost=sec.host.com
        scheduler=wlc
        protocol=tcp
        checktype=connect
        checkport=443
        persistent=600

on Backends we using a script which creates a lo:0 interface ande make a
route using VIP=1.1.1.1

case "$1" in
start)
/sbin/ifconfig lo down
/sbin/ifconfig lo up
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
echo 1 > /proc/sys/net/ipv4/conf/eth1/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/eth1/arp_announce

/sbin/ifconfig lo:0 $VIP netmask 255.255.255.255 up
/sbin/route add -host $VIP dev lo:0

-- 
Alan Morais.

-- 

A marca acima está legalmente protegida.
Antes de imprimir, lembre-se do seu compromisso com o meio ambiente.
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

<Prev in Thread] Current Thread [Next in Thread>
  • [lvs-users] 2 IPs routing to same servers, Alan Morais <=