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

Mailing List Archive: Apache: Users

Load Balancing, no fail over when backend server is down?

 

 

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


ryanlbowman at gmail

Mar 28, 2012, 2:04 PM

Post #1 of 6 (2911 views)
Permalink
Load Balancing, no fail over when backend server is down?

Greetings

I have recently setup Apache load balancing to two backend JBoss
(5.1.0.GA) servers. Communication over AJP, with Sticky Sessions, (no
session replication on the Jboss servers). I'm having a problem with
both Apache 2.2.21 (SUSE 11.3) and 2.4.1 (CentOS 5-something, I
think).

I shut off one of the jboss nodes, the balancer-manager page shows
that node's status as Err, yet Apache is still forwarding requests to
that server, which results in a 503.

Now, I'm making some assumptions here, but they seem pretty reasonable
to me - if one of the nodes is in error status, I assume Apache would
not send requests to it, even with Sticky Sessions. If I leave my
cookies as is (with the jvmRoute to the node that is down), I get a
503 page, which is extremely not useful, and contrary to one of the
main reasons we put in the second JBoss server.

In order to get Apache to send requests to the server that is
available, I have to either delete/modify the browser cookie, or set
the node status to disabled. We have monitoring in place for the
balancer-manager page, to alert me if the status of a node changes so
I can set it to disabled if I need to, but it seems like Apache should
not be sending traffic, even sticky traffic, to down nodes.

But what I want is that if the node is down that all requests would go
to the up node, sticky sessions be damned. If the user's session is
broken/reset in the server switch, that is a small thing compared to
getting a 503 page, making them think the site is down.

Can someone please tell me what am I doing wrong?

<Proxy balancer://jbcluster>
BalancerMember ajp://jbtest1:8009 route=tn1 retry=0 loadfactor=1
BalancerMember ajp://jbtest2:8009 route=tn2 retry=0 loadfactor=1
ProxySet lbmethod=byrequests stickysession=JSESSIONID|jsessionid
scolonpathdelim=On nofailover=Off
</Proxy>

ProxyPass /images !
ProxyPass /apache-info !
ProxyPass /apache-status !
ProxyPass /balancer-manager !

ProxyPassMatch ^(/|/cl/.*|/s/.*|/c/.*|/d/.*|/m/.*|/v/.*|/t/.*|/p/.*|/b/.*|/tw/.*)$
balancer://jbcluster

ProxyPassMatch (\.do.*|\.jsp)$ balancer://jbcluster

ProxyPassMatch (.*/styles/.*\.css|/scripts/.*\.js|/pie/PIE.htc)$
balancer://jbcluster

thanks
ryan

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


anamalikhan at yahoo

Mar 28, 2012, 11:34 PM

Post #2 of 6 (2871 views)
Permalink
Re: Load Balancing, no fail over when backend server is down? [In reply to]

I think Apache mod_proxy do not support health checking for backend servers.

-Anam



________________________________
From: Ryan Bowman <ryanlbowman [at] gmail>
To: users [at] httpd
Sent: Thursday, 29 March 2012, 2:04
Subject: [users [at] http] Load Balancing, no fail over when backend server is down?

Greetings

I have recently setup Apache load balancing to two backend JBoss
(5.1.0.GA) servers. Communication over AJP, with Sticky Sessions, (no
session replication on the Jboss servers). I'm having a problem with
both Apache 2.2.21 (SUSE 11.3) and 2.4.1 (CentOS 5-something, I
think).

I shut off one of the jboss nodes, the balancer-manager page shows
that node's status as Err, yet Apache is still forwarding requests to
that server, which results in a 503.

Now, I'm making some assumptions here, but they seem pretty reasonable
to me - if one of the nodes is in error status, I assume Apache would
not send requests to it, even with Sticky Sessions. If I leave my
cookies as is (with the jvmRoute to the node that is down), I get a
503 page, which is extremely not useful, and contrary to one of the
main reasons we put in the second JBoss server.

In order to get Apache to send requests to the server that is
available, I have to either delete/modify the browser cookie, or set
the node status to disabled. We have monitoring in place for the
balancer-manager page, to alert me if the status of a node changes so
I can set it to disabled if I need to, but it seems like Apache should
not be sending traffic, even sticky traffic, to down nodes.

But what I want is that if the node is down that all requests would go
to the up node, sticky sessions be damned. If the user's session is
broken/reset in the server switch, that is a small thing compared to
getting a 503 page, making them think the site is down.

Can someone please tell me what am I doing wrong?

<Proxy balancer://jbcluster>
  BalancerMember ajp://jbtest1:8009 route=tn1 retry=0 loadfactor=1
  BalancerMember ajp://jbtest2:8009 route=tn2 retry=0 loadfactor=1
  ProxySet lbmethod=byrequests stickysession=JSESSIONID|jsessionid
scolonpathdelim=On nofailover=Off
</Proxy>

ProxyPass /images !
ProxyPass /apache-info !
ProxyPass /apache-status !
ProxyPass /balancer-manager !

ProxyPassMatch ^(/|/cl/.*|/s/.*|/c/.*|/d/.*|/m/.*|/v/.*|/t/.*|/p/.*|/b/.*|/tw/.*)$
balancer://jbcluster

ProxyPassMatch (\.do.*|\.jsp)$ balancer://jbcluster

ProxyPassMatch (.*/styles/.*\.css|/scripts/.*\.js|/pie/PIE.htc)$
balancer://jbcluster

thanks
ryan

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


ryanlbowman at gmail

Mar 29, 2012, 9:14 AM

Post #3 of 6 (2867 views)
Permalink
Re: Load Balancing, no fail over when backend server is down? [In reply to]

That doesn't sound correct to me, the balancer-manager page has a
status column, and shows that one is OK, the other is Err. (see the
attached screen shot)

Apache knows that the backend server is having problems, shouldn't
Apache then know to send the requests to healthy nodes?

On Thu, Mar 29, 2012 at 12:34 AM, Anam Ali Khan <anamalikhan [at] yahoo> wrote:
> I think Apache mod_proxy do not support health checking for backend servers.
>
> -Anam
>
> ________________________________
> From: Ryan Bowman <ryanlbowman [at] gmail>
> To: users [at] httpd
> Sent: Thursday, 29 March 2012, 2:04
> Subject: [users [at] http] Load Balancing, no fail over when backend server is
> down?
>
> Greetings
>
> I have recently setup Apache load balancing to two backend JBoss
> (5.1.0.GA) servers. Communication over AJP, with Sticky Sessions, (no
> session replication on the Jboss servers). I'm having a problem with
> both Apache 2.2.21 (SUSE 11.3) and 2.4.1 (CentOS 5-something, I
> think).
>
> I shut off one of the jboss nodes, the balancer-manager page shows
> that node's status as Err, yet Apache is still forwarding requests to
> that server, which results in a 503.
>
> Now, I'm making some assumptions here, but they seem pretty reasonable
> to me - if one of the nodes is in error status, I assume Apache would
> not send requests to it, even with Sticky Sessions. If I leave my
> cookies as is (with the jvmRoute to the node that is down), I get a
> 503 page, which is extremely not useful, and contrary to one of the
> main reasons we put in the second JBoss server.
>
> In order to get Apache to send requests to the server that is
> available, I have to either delete/modify the browser cookie, or set
> the node status to disabled. We have monitoring in place for the
> balancer-manager page, to alert me if the status of a node changes so
> I can set it to disabled if I need to, but it seems like Apache should
> not be sending traffic, even sticky traffic, to down nodes.
>
> But what I want is that if the node is down that all requests would go
> to the up node, sticky sessions be damned. If the user's session is
> broken/reset in the server switch, that is a small thing compared to
> getting a 503 page, making them think the site is down.
>
> Can someone please tell me what am I doing wrong?
>
> <Proxy balancer://jbcluster>
>   BalancerMember ajp://jbtest1:8009 route=tn1 retry=0 loadfactor=1
>   BalancerMember ajp://jbtest2:8009 route=tn2 retry=0 loadfactor=1
>   ProxySet lbmethod=byrequests stickysession=JSESSIONID|jsessionid
> scolonpathdelim=On nofailover=Off
> </Proxy>
>
> ProxyPass /images !
> ProxyPass /apache-info !
> ProxyPass /apache-status !
> ProxyPass /balancer-manager !
>
> ProxyPassMatch
> ^(/|/cl/.*|/s/.*|/c/.*|/d/.*|/m/.*|/v/.*|/t/.*|/p/.*|/b/.*|/tw/.*)$
> balancer://jbcluster
>
> ProxyPassMatch (\.do.*|\.jsp)$ balancer://jbcluster
>
> ProxyPassMatch (.*/styles/.*\.css|/scripts/.*\.js|/pie/PIE.htc)$
> balancer://jbcluster
>
> thanks
> ryan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>
>
Attachments: screen.jpg (47.7 KB)


tevans.uk at googlemail

Mar 29, 2012, 9:31 AM

Post #4 of 6 (2865 views)
Permalink
Re: Load Balancing, no fail over when backend server is down? [In reply to]

On Thu, Mar 29, 2012 at 5:14 PM, Ryan Bowman <ryanlbowman [at] gmail> wrote:
> That doesn't sound correct to me, the balancer-manager page has a
> status column, and shows that one is OK, the other is Err. (see the
> attached screen shot)
>
> Apache knows that the backend server is having problems, shouldn't
> Apache then know to send the requests to healthy nodes?
>

There are no healthy nodes for that route, and no redirect route
configured for that route.

Also, you have "nofailover=off", but say "what I want is that if the
node is down that all requests would go
to the up node, sticky sessions be damned". Surely you just want this option on?

"""
nofailover - Off - If set to On the session will break if the worker
is in error state or disabled. Set this value to On if backend servers
do not support session replication.
"""

If you have session replication, then both backends should be on the same route.

Cheers

Tom

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


ryanlbowman at gmail

Mar 29, 2012, 9:56 AM

Post #5 of 6 (2868 views)
Permalink
Re: Load Balancing, no fail over when backend server is down? [In reply to]

On Thu, Mar 29, 2012 at 10:31 AM, Tom Evans <tevans.uk [at] googlemail> wrote:
> On Thu, Mar 29, 2012 at 5:14 PM, Ryan Bowman <ryanlbowman [at] gmail> wrote:
>> That doesn't sound correct to me, the balancer-manager page has a
>> status column, and shows that one is OK, the other is Err. (see the
>> attached screen shot)
>>
>> Apache knows that the backend server is having problems, shouldn't
>> Apache then know to send the requests to healthy nodes?
>>
>
> There are no healthy nodes for that route,

You seem to be implying that a given route can have multiple nodes?
As in there can be two jboss servers with the same jvmRoute? Then how
does Apache distinguish the two servers for the purposes of sticky
sessions? That doesn't sound right to me.

> and no redirect route configured for that route.

Perhaps I am misunderstanding the purpose of the redirect rule. the doc says

****
This value is usually set dynamically to enable safe removal of the
node from the cluster. If set all requests without session id will be
redirected to the BalancerMember that has route parameter equal as
this value.
****

which implies to me that requests WITH session id and that route
specified will still be sent to that node, which then yields the exact
same behavior I'm getting now. Requests without the route in the
session id will go to node 1, but since node 2 is down, Apache is
already sending new requests to node 1. what I need is for requests
destined for route 2 to fail over to a different route, because route
2 is broken.


> Also, you have "nofailover=off", but say "what I want is that if the
> node is down that all requests would go
> to the up node, sticky sessions be damned". Surely you just want this option on?
>
> """
> nofailover      - Off - If set to On the session will break if the worker
> is in error state or disabled. Set this value to On if backend servers
> do not support session replication.
> """

I get the same behavior no matter what if nofailover is set to On or Off.

>
> If you have session replication, then both backends should be on the same route.

Clearly, that is the optimal solution, but we do not have the time to
work on that particular puzzle right now.

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

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


enabors at saa

Apr 20, 2012, 9:23 AM

Post #6 of 6 (2824 views)
Permalink
Re: Load Balancing, no fail over when backend server is down? [In reply to]

Backend servers sending 503 status in the worker's header can be used in the
balancer to mark it as Err.

The config is like this w/ failonstatus=503


Header add Set-Cookie "BALANCEID=backend.%{BALANCER_WORKER_ROUTE}e; path=/;"
env=BALANCER_ROUTE_CHANGED


ProxyRequests Off
ProxyPreserveHost On
<Proxy balancer://mycluser/>
BalancerMember http://venus.saa.com/ route=venus
BalancerMember http://saturn.saa.com/ route=saturn
</Proxy>
ProxyPass /balancer-manager !

ProxyPass / balancer://mycluser/ stickysession=BALANCEID nofailover=Off
failonstatus=503


ProxyPassReverse / balancer://mycluser/


--
View this message in context: http://apache-http-server.18135.n6.nabble.com/users-httpd-Load-Balancing-no-fail-over-when-backend-server-is-down-tp4741407p4902482.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.