LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] LVS balancing real server with 2 ip address

To: <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [lvs-users] LVS balancing real server with 2 ip address
From: "Roberto Galluzzi" <Roberto.Galluzzi@xxxxxxxxxxxx>
Date: Tue, 27 Sep 2011 08:47:54 +0200
Hello,

I need balancing a single real server running 2 Squid instances on different ip 
address (but same interface). This is the the environment:

------------------DIRECTOR------------------

Kernel = 2.6.16
IPVS = 1.2.1
IPVSADM = 1.24

IP  = 172.16.1.136
VIP = 172.16.1.139

LVS-DR

eth0 = 172.16.1.136
eth0:vip = 172.16.1.139

net.ipv4.ip_forward = 0

ipvsadm -A -t 172.16.1.139:8080 -s lblc
ipvsadm -a -t 172.16.1.139:8080 -r 172.16.1.56:8080 -g
ipvsadm -a -t 172.16.1.139:8080 -r 172.16.1.52:8080 -g


------------------REAL SERVER------------------

Kernel = 2.6.32

Squid1 http_port = 172.16.1.56:8080
Squid2 http_port = 172.16.1.52:8080

eth0 = 172.16.1.56
eth0:ist2 = 172.16.1.52
lo:vip = 172.16.1.139 (netmask 255.255.255.255)

net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2

--------------------------------------------------

In this mode It doesn't work. I noticed that nestat on real server shows this:

172.16.1.56:8080         LISTEN
172.16.1.52:8080         LISTEN

Whena I stopped a Squid instance and set the only one without specifying ip 
address:

"http_port 8080" instead of "http_port 172.16.1.56:8080"

It works and netstat show this:

0.0.0.0:8080          LISTEN

My question is: in LVS can I have services on the same server listening on 
different ip address but same port? How can I implement this?

Thank you very much
Roberto


_______________________________________________
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>