--- Alan Murrell <silkbc@xxxxxxxxx> wrote:
> Okay, now I'mgetting a little confoosled :-) So I
> can
> direct a WWW or FTP request to the proper cluster
> based on the VIP it is coming in on. Easy enough.
Yes, you're creating SERVICE GROUPS which have the VIP
and PORT and ETHERNET device in them. Like my
pseudo-code example.
> If I were to do as I propose above (three different
> VIP's with WWW and FTP traffic being directed:
Your example was not correct, I've fixed it below
(note that 192.168.2.0 is the PUBLIC network and
192.168.1.0 is the PRIVATE network):
>
> linux_http_group {
> Port 80
> IP 192.168.2.1 eth0:1 <==1st PUBLIC VIP
> real_server1 { 192.168.1.1
> }
> real_server2 { 192.168.1.2
> }
> }
>
> ntdb_http_group {
> Port 80
> IP 192.168.2.2 eth0:2 <==2nd PUBLIC VIP
> real_server1 { 192.168.1.3
> }
> real_server2 { 192.168.1.4
> }
> }
>
> nt_http_group {
> Port 80
> IP 192.168.2.3 eth0:3 <==3rd PUBLIC VIP
> real_server1 { 192.168.1.5
> }
> real_server2 { 192.168.1.6
> }
> }
>
ALL of your Real Servers need to be on the same
network, and same PRIVATE network as the NAT Router on
the load balancer. In your example you had your real
servers on different networks which is incorrect...
I've corrected them above. If your real_server1 and
real_server2 are 192.168.1.2 and 192.168.1.3 then that
is what they are across the board (though real servers
could also have their own VIP's like eth1:1
192.168.1.10 or something). Same for public network
VIPs they must all be on same network, 192.168.2.0 in
my example.
You can do like this using 3 public VIPs, then you can
use port 80 for all:
> linux_http_group {
> Port 80
> IP 192.168.100.1 eth0:1
> ntdb_http_group {
> Port 80
> IP 192.168.100.2 eth0:2
> ntdb_http_group {
> Port 80
> IP 192.168.100.3 eth0:3
#rc.lvs script - Three pub VIP addresses example.
#This sets up a NAT router table to load balance
#port 80 on pub side to 80 on prv side.
ipvsadm -A -t 192.168.2.1:80 -s wlc
ipvsadm -a -t 192.168.2.1:80 -r 192.168.1.1:80 -m
ipvsadm -a -t 192.168.2.1:80 -r 192.168.1.2:80 -m
ipvsadm -A -t 192.168.2.2:80 -s wlc
ipvsadm -a -t 192.168.2.2:80 -r 192.168.1.3:80 -m
ipvsadm -a -t 192.168.2.2:80 -r 192.168.1.4:80 -m
ipvsadm -A -t 192.168.2.3:80 -s wlc
ipvsadm -a -t 192.168.2.3:80 -r 192.168.1.5:80 -m
ipvsadm -a -t 192.168.2.3:80 -r 192.168.1.6:80 -m
Or if you use 1 single VIP then you would have to use
different PORTS like this (but you can map those
different ports on the public side to port 80 on the
private side with your ipvsadm NAT router table
statements):
> linux_http_group {
> Port 80
> IP 192.168.2.1 eth0:1
> ntdb_http_group {
> Port 81
> IP 192.168.2.1 eth0:1
> ntdb_http_group {
> Port 82
> IP 192.168.2.1 eth0:1
#rc.lvs script - One pub VIP addr example.
#This sets up a NAT router table to load balance
#ports 80/81/82 on pub side to 80 on prv side.
ipvsadm -A -t 192.168.2.1:80 -s wlc
ipvsadm -a -t 192.168.2.1:80 -r 192.168.1.1:80 -m
ipvsadm -a -t 192.168.2.1:80 -r 192.168.1.2:80 -m
ipvsadm -A -t 192.168.2.1:81 -s wlc
ipvsadm -a -t 192.168.2.1:81 -r 192.168.1.3:80 -m
ipvsadm -a -t 192.168.2.1:81 -r 192.168.1.4:80 -m
ipvsadm -A -t 192.168.2.1:82 -s wlc
ipvsadm -a -t 192.168.2.1:82 -r 192.168.1.5:80 -m
ipvsadm -a -t 192.168.2.1:82 -r 192.168.1.6:80 -m
Now in the above load balancing pairs 1.1/1.2,
1.3/1.4, 1.5/1.6, I supposed you could also overlap
them, like you could have 1.1/1.2, 1.2/1.3 but you
need to think about which IP or VIP addresses on the
real servers are attached to what services, http, http
with database, etc.... You could also add 1.4, 1.5,
1.6 VIP addresses to your real servers as VIPs for
example. Just different ways to do it all.
Peter
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
|