« Drupal installation on milton.comUtility for deleting single arp entries from Cisco routers »

Load Balanced LVS-NAT FTP Server w/ Keepalived+iptables+proftpd HOWTO

12/17/05

Permalink 02:08:09 pm, by Stephen Email , 1248 words   English (US)
Categories: Open Source, Sysadmin Tricks

Load Balanced LVS-NAT FTP Server w/ Keepalived+iptables+proftpd HOWTO

I was recently tasked with setting up a 5 server cluster for load balanced FTP and static web content serving. I found enough information on the Linux Virtual Server Project and Keepalived to get the standard failover and web protocol load balancing working well. However, when it comes to FTP and NAT, many of the online docs make comments like "Multi-port protocols are too hard!", and "I can get active ftp to work, can I somehow disable passive since it doesn't work?", and "this example config bypasses the virtual server for FTP, and isn't load balanced". In fact I found so many docs on FTP related issues, where the author only presented 10% of the solution, that putting all of them together into a working solution was dificult. So here I will attempt to gather together the complete working configuration that I finally stumbled upon.

The software packages that I used to complete this solution are:

  • Red Hat Enterprise Linux 4.2 WS (should work identically with Centos 4.2)
  • IPVSADM version 1.24 works properly with the current Red Hat kernel version 2.6.9-22.0.1.EL.
  • Netfilter - iptables - default versions that came with RHEL 4.2
  • ProFTPd version 1.2.10
  • arpreset 0.2 - a package I wrote for resetting single MAC addresses on a Cisco router; helps with making the failover fast
  • check_ftpget.pl - written by Jeremy Hanmer for the excellent Nagios system monitoring project.

My cluster consists of 2 load balancers (setup for active-passive failover), and 3 web/ftp servers. Here is the diagram of how they are networked together:

           VIP: (.10)     VIP: [.1]
              +-+             +-+
              |X|             |X|
              |X|-----LB1-----|X|-----Web1
              |X|  (.2)  [.2] |X|      [.11]
              |X|             |X|
   Router-----|X|             |X|-----Web2
      (.1)    |X|             |X|      [.12]
              |X|             |X|
              |X|-----LB2-----|X|-----Web3
              |X|  (.3)  [.3] |X|      [.13]
              +-+             +-+
           switch             switch

 (192.168.1.0/24)             [192.168.2.0/24]

LB1    = LVS-NAT Master Load Balancer
LB2    = LVS-NAT Backup Load Balancer
Web1-3 = Web & FTP Servers

Note:  (.1) = 192.168.1.1
       [.3] = 192.168.2.3

Pages: 1 · 2 · 3 · 4

No feedback yet

Comments are closed for this post.

The goal for this blog is to have a place to document for posterity all the funky software, hardware, and sysadmin tricks I think up, look up, or mess up. It will also serve as a jumping off point for my own software projects, as well as my test bed for all the crazy open source projects that catch my eye on the net.


Posterity is me. I have a bad memory, and I have forgotten more of these types of tricks than I will ever remember to write down. I've got to start somewhere.

Follow my updates on Twitter

Search

XML Feeds

powered by b2evolution free blog software