LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[newbie] Experimenting with LVS

To: "'lvs-users@xxxxxxxxxxxxxxxxxxxxxx'" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [newbie] Experimenting with LVS
From: Michael Jervis <michael.jervis@xxxxxxxxx>
Date: Tue, 25 Feb 2003 11:30:19 -0000
Hi,

I have been set a task to build a small LVS based network to 'sanity check'
that we can do this. So far, we can't :(

We have two machines to set up with failover and load balancing of an Apache
based web site, all flat HTML. I'm using Redhat 7.2 with the folling LVS
RPMs from the Redhat ftp:

ipvsadm-1.18-8.i386.rpm
scsi_reserve-0.7-6.i386.rpm
piranha-0.7.0-3.i386.rpm

The machines each have two NICs, and I'm aiming to have machine 1 run
primary director, and an Apache instance. Machine 2 will run the backup
director, with the second Apache instance. The idea being that if machine 2
fails, machine 1 will be capable of hosting the site. If machine 1 fails,
machine 2 will take over director and site role until machine 1 is restored
etc.

I'm having some problems getting this working, I'm currently aiming for a
set up with no back up director to simplify things.

Machine 1 has the IP addresses:
10.122.15.41
192.168.0.1

The 10 address is visible on our LAN, the 192 address places it onto a
private network for the LVS system. Apache on this system is set to listen
on 192.168.0.1:80 only.

Machine 2 has the IP adresses:
192.168.0.2
192.168.0.3

Apache is listening on all ip addresses, and is there when I telnet to port
80 on the machine.

When I hit the cluster on the 10 address I only get Machine 2 responding.
lvs.cf is enclosed at end of mail.

My LVS Routing table is:
IP Virtual Server version 0.8.1 (size=65536)                   
Prot LocalAddress:Port Scheduler Flags                         
  -> RemoteAddress:Port             Forward Weight ActiveConn InActConn
TCP  10.122.15.41:80 rr
  -> 192.168.0.2:80                 Masq    1      0          8         
  -> 192.168.0.1:80                 Local   1      0          7

When I change Apache on machine 1 to run on all IP addresses, as expected it
overrides the LVS listening on port 80 and grabs all traffic. So, I assume
in future I'll need to change NIC 1 to 192.168.0.4 and alias the virtual IP
10.122.15.41 to it? How do I do this? I am not exactly a wizard with Linux,
I'm just the poor sap in the office with most skills.

Thanks for any pointers.      

serial_no = 52
primary = 10.122.15.41
service = lvs
backup = 0.0.0.0
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = nat
nat_nmask = 255.255.0.0
reservation_conflict_action = preempt
debug_level = NONE
virtual web1 {
     active = 1
     address = 10.122.15.41 eth0:1
     vip_nmask = 255.255.0.0
     port = 80
     send = "GET / HTTP/1.0\r\n\r\n"
     expect = "HTTP"
     load_monitor = uptime
     scheduler = rr
     protocol = tcp
     timeout = 6
     reentry = 15
     quiesce_server = 0
     server Real2 {
         address = 192.168.0.2
         active = 1
         weight = 1
     }
     server Real1 {
         address = 192.168.0.1
         active = 1
         weight = 1
     }
}
<Prev in Thread] Current Thread [Next in Thread>