Administration
  Home arrow Administration arrow Configuring Load-Balanced Clusters
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Configuring Load-Balanced Clusters
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-05-08

    Table of Contents:
  • Configuring Load-Balanced Clusters
  • Testing the System
  • Testing the System continued
  • Adding HA to LB

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    Configuring Load-Balanced Clusters
    (Page 1 of 4 )

    In this conclusion to a two-part series on load-balanced clusters, you'll learn how to configure the load balancer and test the system. This article 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.

    Configuring the Load Balancer

    On lb, create the load balancer configuration file, /etc/ha.d/ldirectord.cf:

      checktimeout=10
      checkinterval=2
      autoreload=no
      logfile="local0"
      quiescent=no
      virtual=70.253.158.42:80

              real=70.253.158.41:80 gate
             
    real=70.253.158.45:80 gate
             
    service=http
             
    request="director.html"
             
    receive="I'm alive!"
             
    scheduler=rr
              protocol=tcp
              checktype=negotiate

    Ifquiescentisyes, a faulty realserver gets a weight of0but remains in the LVS routing table; we’ve set it tono, so dead servers will be removed from the pool. The weight of a server reflects its capacity relative to the other servers. For a simple LB scheme like ours, all live servers have a weight of1and dead ones have a weight of0.

    Ifchecktypeisnegotiate, the director will make an HTTP request to each of the realservers for the URLrequest, and see if its contents contain the string value forreceive. If the value ischeck, only a quick TCP check will be done, andrequestandreceivewill be ignored.

    The system startup files in /etc for ldirectord should have already been created during the installation. Ultra Monkey also installed Heartbeat, which we aren’t using yet, so let’s disable it for now:

      # update-rc.d heartbeat remove
     
    update-rc.d: /etc/init.d/heartbeat exists during rc.d purge (use -f to force)

    The load balancer monitors the health of the web servers by regularly requesting the file we specified in ldirectord.cf (request="director.html").

    Since this server will be responding to web requests at the VIP address (70.253.158.42), we’d better tell the server about it. Edit /etc/network/interfaces and add these lines to create the alias deviceeth0:0:

      auto eth0:0
     
    iface eth0:0 inet static
             
    address 70.253.158.42
             
    netmask 255.255.255.248
         
    # These should have the same values as for eth0:
             
    network ...
             
    broadcast ...
             
    gateway ...

    Now, fire up this new IP address:

      # ifup eth0:0

    Finally, start your engines on lb:

      # /etc/init.d/ldirectord start
      Starting ldirectord... success

    More Administration Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Linux System Administration," published by...
     

    Buy this book now. This article is excerpted from chapter seven of Linux System Administration, written by Tom Adelstein and Bill Lubanovic (O'Reilly, 2007; ISBN: 0596009526). Check it out today at your favorite bookstore. Buy this book now.

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway