Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion).

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


durgaprasadbabu.pratapani at rbccm

Apr 4, 2012, 5:22 PM

Post #1 of 8 (520 views)
Permalink
How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion).

Hi,

Greetings !!

I am writing this after lot of googling. I could not get a direct answer in
my searches.
As I don't have a more time to do R&D, I am sending this mail for a quick
solution.

I sucessfully did the following :
--------------------------------------------
I am able to have one HTTPD server running and 2 tomcats instances ( load
balanced ) for the single HTTPD server.
I was able to sucessfully test the Session replication in case of 1 tomcat
instance going down.
The request is serviced by another tomcat instance and session is also
replicated.

I am unable to do the following :
---------------------------------------------
In the above case if the machine hosting the HTTPD is down , the requests
are not serviced although the tomcast instances are available.
How do I setup HTTPD servers as load balaced. That is 2 or more machines
serving the same address.
There is virtual host to support a single machine serve multple address .

Just would like to understand if there is a simple way to set up 2 or more
machines running HTTPD instances to serve a same request ( in a load
balanced fashion).

Greatly appreciate your help.

Thanks ,
Durga Prasad

--
View this message in context: http://old.nabble.com/How-to-set-up-2-or-more-machines-running-HTTPD-instances-to-serve-a-same-request-%28-in-a-load-balanced-fashion%29.-tp33564835p33564835.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


icicimov at gmail

Apr 4, 2012, 10:11 PM

Post #2 of 8 (507 views)
Permalink
Re: How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion). [In reply to]

I have done this with mod_jk but the tomcats were not clustered. Ive seen a
thread here using mod_proxy_balancer and tomcat cluster but OP was saying
that broke the tomcat session replication somehow.
What have you exactly tried till now? There is more than one way to achive
this.
On Apr 5, 2012 10:23 AM, "Pratapani" <durgaprasadbabu.pratapani [at] rbccm>
wrote:

>
> Hi,
>
> Greetings !!
>
> I am writing this after lot of googling. I could not get a direct answer in
> my searches.
> As I don't have a more time to do R&D, I am sending this mail for a quick
> solution.
>
> I sucessfully did the following :
> --------------------------------------------
> I am able to have one HTTPD server running and 2 tomcats instances ( load
> balanced ) for the single HTTPD server.
> I was able to sucessfully test the Session replication in case of 1 tomcat
> instance going down.
> The request is serviced by another tomcat instance and session is also
> replicated.
>
> I am unable to do the following :
> ---------------------------------------------
> In the above case if the machine hosting the HTTPD is down , the requests
> are not serviced although the tomcast instances are available.
> How do I setup HTTPD servers as load balaced. That is 2 or more machines
> serving the same address.
> There is virtual host to support a single machine serve multple address .
>
> Just would like to understand if there is a simple way to set up 2 or more
> machines running HTTPD instances to serve a same request ( in a load
> balanced fashion).
>
> Greatly appreciate your help.
>
> Thanks ,
> Durga Prasad
>
> --
> View this message in context:
> http://old.nabble.com/How-to-set-up-2-or-more-machines-running-HTTPD-instances-to-serve-a-same-request-%28-in-a-load-balanced-fashion%29.-tp33564835p33564835.html
> Sent from the Apache HTTP Server - Users mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>


tevans.uk at googlemail

Apr 5, 2012, 2:46 AM

Post #3 of 8 (502 views)
Permalink
Re: How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion). [In reply to]

On Thu, Apr 5, 2012 at 1:22 AM, Pratapani
<durgaprasadbabu.pratapani [at] rbccm> wrote:
>
> Hi,
>
> Greetings !!
>
> I am writing this after lot of googling. I could not get a direct answer in
> my searches.
> As I  don't have a more time to do R&D, I am sending this mail for a quick
> solution.
>
> I sucessfully did the following :
> --------------------------------------------
> I am able to have one HTTPD server running and 2 tomcats instances ( load
> balanced )  for  the single HTTPD server.
> I was able to sucessfully test the Session replication in case of 1 tomcat
> instance going down.
> The request is serviced by another tomcat instance and session is also
> replicated.
>
> I am unable to do the following :
> ---------------------------------------------
> In the above case if the machine hosting the HTTPD is down ,  the requests
> are not serviced although the tomcast instances are available.
> How do I setup HTTPD servers as load balaced. That is 2 or more machines
> serving the same address.
> There is virtual host to support a single machine serve multple address .
>
> Just would like to understand if there is a simple way to set up 2 or more
> machines running HTTPD instances to serve a same request ( in a load
> balanced fashion).
>
> Greatly appreciate your help.
>
> Thanks ,
> Durga Prasad
>

This is outside the scope of Apache tbh. We do this though.

We have a pair of servers acting as front end proxies.
Each server has two HA addresses - one server is the master on one HA
address, the other server master on the other.
Each server also has all the public IPs we intend to serve on the
loopback interface. This allows httpd to bind to the correct IP
addresses on each box.
Our edge routers forward traffic for those public IPs in a round robin
format via the two HA addresses.
If either server is down, the request is handled by the other server,
due to the magic of HA.

The technologies we use here:

All servers run FreeBSD. Round robin load balancing happens by PF (I
think). We use CARP addresses for HA - FreeBSD version of VRRP.

I'm afraid I only know the architectural design of our system; I can't
help you with specifics - I leave all the network bits to the network
team.

You can of course do similar things with any number of commercial load
balancers, like an F5 or a BigIP.

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


durgaprasadbabu.pratapani at rbccm

Apr 6, 2012, 8:34 AM

Post #4 of 8 (508 views)
Permalink
Re: How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion). [In reply to]

Thanks for the reply.
I have used the mod_proxy . Changed the httpd.conf to have 2 tomcat
instances in cluster.
<Proxy balancer://testcluster stickysession=JSESSIONID>
BalancerMember ajp://127.0.0.1:8009 min=10 max=100 route=node1 loadfactor=1
BalancerMember ajp://127.0.0.1:8019 min=20 max=200 route=node2 loadfactor=1
</Proxy>
Tomcat clustering works perfect. If Tomcat instance 1 ( node1 ) is shutdown
, the request is serviced by instance 2 .

I would like to have Apache HTTP Server also in cluster and avoid the single
point of failure of Apache HTTP server i.e if one instance of Apache HTTP
server is down, the application should still work.

I did not find any configuration setting to make 2 Apache HTTP servers
instances into a cluster.

Appreciate your help.

Durga Prasad


Igor Cicimov wrote:
>
> I have done this with mod_jk but the tomcats were not clustered. Ive seen
> a
> thread here using mod_proxy_balancer and tomcat cluster but OP was saying
> that broke the tomcat session replication somehow.
> What have you exactly tried till now? There is more than one way to achive
> this.
> On Apr 5, 2012 10:23 AM, "Pratapani"
> <durgaprasadbabu.pratapani [at] rbccm>
> wrote:
>
>>
>> Hi,
>>
>> Greetings !!
>>
>> I am writing this after lot of googling. I could not get a direct answer
>> in
>> my searches.
>> As I don't have a more time to do R&D, I am sending this mail for a
>> quick
>> solution.
>>
>> I sucessfully did the following :
>> --------------------------------------------
>> I am able to have one HTTPD server running and 2 tomcats instances ( load
>> balanced ) for the single HTTPD server.
>> I was able to sucessfully test the Session replication in case of 1
>> tomcat
>> instance going down.
>> The request is serviced by another tomcat instance and session is also
>> replicated.
>>
>> I am unable to do the following :
>> ---------------------------------------------
>> In the above case if the machine hosting the HTTPD is down , the
>> requests
>> are not serviced although the tomcast instances are available.
>> How do I setup HTTPD servers as load balaced. That is 2 or more machines
>> serving the same address.
>> There is virtual host to support a single machine serve multple address .
>>
>> Just would like to understand if there is a simple way to set up 2 or
>> more
>> machines running HTTPD instances to serve a same request ( in a load
>> balanced fashion).
>>
>> Greatly appreciate your help.
>>
>> Thanks ,
>> Durga Prasad
>>
>> --
>> View this message in context:
>> http://old.nabble.com/How-to-set-up-2-or-more-machines-running-HTTPD-instances-to-serve-a-same-request-%28-in-a-load-balanced-fashion%29.-tp33564835p33564835.html
>> Sent from the Apache HTTP Server - Users mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe [at] httpd
>> For additional commands, e-mail: users-help [at] httpd
>>
>>
>
>

--
View this message in context: http://old.nabble.com/How-to-set-up-2-or-more-machines-running-HTTPD-instances-to-serve-a-same-request-%28-in-a-load-balanced-fashion%29.-tp33564835p33635679.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


DRuggeri at primary

Apr 6, 2012, 3:30 PM

Post #5 of 8 (499 views)
Permalink
Re: How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion). [In reply to]

On 4/6/2012 10:34 AM, Pratapani wrote:
> Thanks for the reply.
> I have used the mod_proxy . Changed the httpd.conf to have 2 tomcat
> instances in cluster.
> <Proxy balancer://testcluster stickysession=JSESSIONID>
> BalancerMember ajp://127.0.0.1:8009 min=10 max=100 route=node1 loadfactor=1
> BalancerMember ajp://127.0.0.1:8019 min=20 max=200 route=node2 loadfactor=1
> </Proxy>
> Tomcat clustering works perfect. If Tomcat instance 1 ( node1 ) is shutdown
> , the request is serviced by instance 2 .
>
> I would like to have Apache HTTP Server also in cluster and avoid the single
> point of failure of Apache HTTP server i.e if one instance of Apache HTTP
> server is down, the application should still work.
>
> I did not find any configuration setting to make 2 Apache HTTP servers
> instances into a cluster.
>
> Appreciate your help.
>
> Durga Prasad

Durga;
What you are describing is outside the scope of httpd, unfortunately.
There are a few options - the two most popular are:
**Configure an HA VIP using OS-level clustering utilities* - this is the
windows managed integrated load balancer, or Linux-HA w/heartbeat. In
this configuration, you would bind both httpd instance to the same VIP
and allow the clustering utility to manage what node is live. With this
setup, your capacity at the web layer is limited to the capacity of a
single httpd server.
**An external load balancer* - this can be a hardware IP sprayer,
firewall, software service on another machine, etc. Anything operating
on layer 4 or up would do. In this sort of configuration you will bind
httpd to a distinct IP address bound to each machine in the load
balanced pair and let the upstream service manage the traffic. Capacity
in this configuration at the web layer scales linearly with each httpd
server. Beware, this option can be expensive.

--
Daniel Ruggeri


durgaprasadbabu.pratapani at rbccm

Apr 6, 2012, 3:52 PM

Post #6 of 8 (511 views)
Permalink
Re: How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion). [In reply to]

Thanks for the replies.
We are going to use "F5" for load balancing the Tomcat instances. As
mentioned all the machines will share the same VIP.
No Apache HTTP server for now !!

I was able to use the session replication ( PersistenceManager) on tomcat
along with Apache HTTP server. I have to check how I can achieve the same
thing using F5.

Appreciate if you can share quick information for using tomcat session
replication along with F5.

Durga Prasad



Daniel Ruggeri wrote:
>
> On 4/6/2012 10:34 AM, Pratapani wrote:
>> Thanks for the reply.
>> I have used the mod_proxy . Changed the httpd.conf to have 2 tomcat
>> instances in cluster.
>> <Proxy balancer://testcluster stickysession=JSESSIONID>
>> BalancerMember ajp://127.0.0.1:8009 min=10 max=100 route=node1
>> loadfactor=1
>> BalancerMember ajp://127.0.0.1:8019 min=20 max=200 route=node2
>> loadfactor=1
>> </Proxy>
>> Tomcat clustering works perfect. If Tomcat instance 1 ( node1 ) is
>> shutdown
>> , the request is serviced by instance 2 .
>>
>> I would like to have Apache HTTP Server also in cluster and avoid the
>> single
>> point of failure of Apache HTTP server i.e if one instance of Apache HTTP
>> server is down, the application should still work.
>>
>> I did not find any configuration setting to make 2 Apache HTTP servers
>> instances into a cluster.
>>
>> Appreciate your help.
>>
>> Durga Prasad
>
> Durga;
> What you are describing is outside the scope of httpd, unfortunately.
> There are a few options - the two most popular are:
> **Configure an HA VIP using OS-level clustering utilities* - this is the
> windows managed integrated load balancer, or Linux-HA w/heartbeat. In
> this configuration, you would bind both httpd instance to the same VIP
> and allow the clustering utility to manage what node is live. With this
> setup, your capacity at the web layer is limited to the capacity of a
> single httpd server.
> **An external load balancer* - this can be a hardware IP sprayer,
> firewall, software service on another machine, etc. Anything operating
> on layer 4 or up would do. In this sort of configuration you will bind
> httpd to a distinct IP address bound to each machine in the load
> balanced pair and let the upstream service manage the traffic. Capacity
> in this configuration at the web layer scales linearly with each httpd
> server. Beware, this option can be expensive.
>
> --
> Daniel Ruggeri
>
>
>

--
View this message in context: http://old.nabble.com/How-to-set-up-2-or-more-machines-running-HTTPD-instances-to-serve-a-same-request-%28-in-a-load-balanced-fashion%29.-tp33564835p33646045.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


DRuggeri at primary

Apr 6, 2012, 7:22 PM

Post #7 of 8 (497 views)
Permalink
Re: How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion). [In reply to]

On 4/6/2012 5:52 PM, Pratapani wrote:
> Thanks for the replies.
> We are going to use "F5" for load balancing the Tomcat instances. As
> mentioned all the machines will share the same VIP.
> No Apache HTTP server for now !!
>
> I was able to use the session replication ( PersistenceManager) on tomcat
> along with Apache HTTP server. I have to check how I can achieve the same
> thing using F5.
>
> Appreciate if you can share quick information for using tomcat session
> replication along with F5.
>
> Durga Prasad

Session replication would have to happen inside the Tomcat cluster.
There's lots of documentation on how to set up clustering in Tomcat.
Session persistence/stickiness would happen at the F5 load balancer.

--
Daniel Ruggeri


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


durgaprasadbabu.pratapani at rbccm

Apr 7, 2012, 9:53 AM

Post #8 of 8 (501 views)
Permalink
Re: How to set up 2 or more machines running HTTPD instances to serve a same request ( in a load balanced fashion). [In reply to]

Thanks for the reply.
Is there a document or link that you can share to get session persistence
using F5 and tomcat.


Daniel Ruggeri wrote:
>
> On 4/6/2012 5:52 PM, Pratapani wrote:
>> Thanks for the replies.
>> We are going to use "F5" for load balancing the Tomcat instances. As
>> mentioned all the machines will share the same VIP.
>> No Apache HTTP server for now !!
>>
>> I was able to use the session replication ( PersistenceManager) on tomcat
>> along with Apache HTTP server. I have to check how I can achieve the
>> same
>> thing using F5.
>>
>> Appreciate if you can share quick information for using tomcat session
>> replication along with F5.
>>
>> Durga Prasad
>
> Session replication would have to happen inside the Tomcat cluster.
> There's lots of documentation on how to set up clustering in Tomcat.
> Session persistence/stickiness would happen at the F5 load balancer.
>
> --
> Daniel Ruggeri
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>
>

--
View this message in context: http://old.nabble.com/How-to-set-up-2-or-more-machines-running-HTTPD-instances-to-serve-a-same-request-%28-in-a-load-balanced-fashion%29.-tp33564835p33649097.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.