Home arrow Site Administration arrow Page 4 - Load-Balanced Clusters

Configuring the Realservers (Apache Nodes) - Administration

If you want or need the power of a supercomputer but can't afford one, you might look into creating a computer cluster. If you're interested in this relatively inexpensive solution, this two-part article series gives you a good introduction. It is excerpted from chapter seven of Linux System Administration, written by Tom Adelstein and Bill Lubanovic (O'Reilly, 2007; ISBN: 0596009526). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

  1. Load-Balanced Clusters
  2. Load-Balancing Software
  3. ldirectord
  4. Configuring the Realservers (Apache Nodes)
By: O'Reilly Media
Rating: starstarstarstarstar / 3
May 01, 2008

print this article



On each realserver (web1 and web2), do the following:

  1. If the server doesnít already have Apache installed, install it:

      # apt-get install apache2

    If you havenít installed the content files for your web site, you can do it now or after load balancing is set up.
  2. Install iproute (a Linux networking package with more features than older utilities such as ifconfig and route):

      # apt-get install iproute 
  3. Add these lines to /etc/sysctl.conf:

      net.ipv4.conf.all.arp_ignore = 1 
      net.ipv4.conf.eth0.arp_ignore = 1
      net.ipv4.conf.all.arp_announce = 2
      net.ipv4.conf.eth0.arp_announce = 2 
  4. Get the changes into the kernel:

      # sysctl -p
      net.ipv4.conf.all.arp_ignore = 1
      net.ipv4.conf.eth0.arp_ignore = 1
      net.ipv4.conf.all.arp_announce = 2
      net.ipv4.conf.eth0.arp_announce = 2 
  5. Assuming that your realserver is a Debian system, edit the /etc/network/interfaces file, associating the VIP ( with the loopback aliaslo:0:

      auto lo:0
      iface lo:0 inet static
          pre-up sysctl -p > /dev/null 
  6.  Enable the loopback alias:

      # ifup lo:0 
  7. Create the file /var/www/ldirector.html with the contents:

      I'm alive! 
  8. On web1:

      # echo "I'm web1" > /var/www/which.html 
  9. On web2

      # echo "I'm web2" > /var/www/which.html 
  10. Start Apache, or restart it if itís already running:

     # /etc/init.d/apache2 restart

The Apache access logs should not yet show any activity, because lb is not talking to them yet.

Please check back next week for the conclusion to this article.

>>> More Site Administration Articles          >>> More By O'Reilly Media

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates


Dev Shed Tutorial Topics: