You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ryan Bowman <ry...@gmail.com> on 2012/03/28 23:04:31 UTC

[users@httpd] 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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Load Balancing, no fail over when backend server is down?

Posted by enabors <en...@saa.com>.
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Load Balancing, no fail over when backend server is down?

Posted by Ryan Bowman <ry...@gmail.com>.
On Thu, Mar 29, 2012 at 10:31 AM, Tom Evans <te...@googlemail.com> wrote:
> On Thu, Mar 29, 2012 at 5:14 PM, Ryan Bowman <ry...@gmail.com> 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@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Load Balancing, no fail over when backend server is down?

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Mar 29, 2012 at 5:14 PM, Ryan Bowman <ry...@gmail.com> 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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Load Balancing, no fail over when backend server is down?

Posted by Ryan Bowman <ry...@gmail.com>.
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 <an...@yahoo.com> wrote:
> I think Apache mod_proxy do not support health checking for backend servers.
>
> -Anam
>
> ________________________________
> From: Ryan Bowman <ry...@gmail.com>
> To: users@httpd.apache.org
> Sent: Thursday, 29 March 2012, 2:04
> Subject: [users@httpd] 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@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>

Re: [users@httpd] Load Balancing, no fail over when backend server is down?

Posted by Anam Ali Khan <an...@yahoo.com>.
I think Apache mod_proxy do not support health checking for backend servers.

-Anam



________________________________
 From: Ryan Bowman <ry...@gmail.com>
To: users@httpd.apache.org 
Sent: Thursday, 29 March 2012, 2:04
Subject: [users@httpd] 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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org