Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008

    Exclamation 2 Tomcat with single Apache with load balancing ???


    We want to implementing the load balancing for our domain, if the traffic is heavy and 8080 (i.e. currently integrated with apache) doesn''t serve more that time the apache will call 8081 and serve to the request without any problem.

    We want to access our site (i.e. run on port 80). Please guide us it is possible or not ?

    Please guide me how can i do this ?

    Thank you

    Linux Blog

  2. #2
    Join Date
    Apr 2008

    Linux Blog

  3. #3
    Join Date
    Oct 2003
    The Netherlands

    Here is a setup that I've done using Glassfish (also a Java application server running on port 8080) and it works pretty well for me.
    In my case I used 3 separate machines, but you can just as well use a single machine.

    Instead of Apache, I've just used something like HAProxy (though you can use Apache with mod_proxy as well)
    You can find and install HAProxy from here:
    How to install on CentOS:

    My configuration is as follows:

    cat /etc/haproxy.cfg
    maxconn 8192 # Total Max Connections. This is dependent on ulimit
    nbproc 2 # Number of processing cores. Dual Dual-core Opteron is 4 cores for example.
    mode http
    clitimeout 60000
    srvtimeout 30000
    contimeout 4000
    option httpclose # Disable Keepalive

    listen http_proxy
    balance roundrobin # Load Balancing algorithm
    stats enable
    option httpchk
    option forwardfor # This sets X-Forwarded-For
    ## Define your servers to balance
    server wdc1 wdc1:8080 weight 1 maxconn 2048 check
    server wdc2 wdc2:8080 weight 1 maxconn 2048 check

    wdc1 and wdc2 are in the /etc/hosts file in this case.

    in your case you should use:
    server tomcat1 weight 1 maxconn 2048 check
    server tomcat2 weight 1 maxconn 2048 check

    HAProxy will check both servers and will not serve traffic to those who are not responding properly.

    Hope this helps

Similar Threads

  1. Load Balancing between Sites on a Single Server...
    By DariusY in forum Hosting Security and Technology
    Replies: 6
    Last Post: 01-17-2007, 10:30 PM
  2. Needed: Linux, Load balancing, Apache and MySQL Guru
    By myusername in forum Employment / Job Offers
    Replies: 4
    Last Post: 03-21-2005, 12:50 PM
  3. Soft-Load Balancing for Apache+PHP
    By dcabbar in forum Hosting Security and Technology
    Replies: 3
    Last Post: 03-20-2005, 07:39 PM
  4. Load Balancing and single points of failure.
    By kushal in forum Dedicated Server
    Replies: 6
    Last Post: 04-28-2003, 09:20 PM
  5. Anyone try mod_backhand -- apache load balancing
    By maxbear in forum Hosting Security and Technology
    Replies: 9
    Last Post: 07-10-2002, 11:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts