W
W
watsonstudio2016-03-20 14:14:43
linux
watsonstudio, 2016-03-20 14:14:43

How to properly configure LVS (IPVSADM)?

Hello.
I'm trying to figure out how to load balance with LVS.
There are initial data:
- 4 servers
- Each server has an external address and an internal one (servers are connected in a local network)
Server 1 (director): external IP: 179.60.167.1, internal IP: 192.168.0.1
Server 2: external IP: 179.60.167.2 , internal IP: 192.168.0.2
Server 3: external IP: 179.60.167.3, internal IP: 192.168.0.3
Server 4 (for tests): external IP: 179.60.167.4, internal IP: 192.168.0.4
I need to configure LVS Direct Routing.
VIP: 192.168.0.100 (virtual IP)
Configuration algorithm on director:
ipvsadm -A -t 192.168.0.100:80 -s rr
ipvsadm -a -t 192.168.0.100:80 -r 192.168.0.2:80 -w
1
0.0 broadcast 192.168.255.255
Algorithm on the frontends:
iptables -t nat -A PREROUTING -d 192.168.0.100 -j REDIRECT (I don’t understand the meaning, some manuals don’t have this step)
With this setting, everything works fine, but the balancer is only available inside the local network by virtual address, but I need to configure it so that the balancer receives requests from 179.60.167.1, transfers them to the local network, in which the fronts would already return the result to clients.
There is also a suspicion that what I want is no longer Direct Routing, because. we have different networks. Perhaps, if I'm right, then the scheme will be acceptable when the virtual address is on the 179.*.*.* network, so for this case I need to request an additional IP from the host?
This is the first time I've encountered setting up a network and LVS, I'm asking for help.
ps All IPs are fictitious, all matches with real IPs are considered random. :)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question