You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ed Young <ej...@summitbid.com> on 2012/08/31 03:13:40 UTC
[users@httpd] Apache + 2 tomcat appserver failover configuration
I've set up a load balancing configuration based on an Apache server
and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
that Tomcat6B is a failover server, so if Tomcat6A goes down, Tomcat6B
will handle all subsequent requests.
I have two questions:
1. Does mod_proxy use the workers.properties file? It doesn't seem to
make any difference what is in workers.properties.
2. How can I set this system up for a failover configuration?
This is killing me. I'm using mod_proxy, mod_proxy_balancer, mod_ajp.
In the load balancer howto, it specifies the configuration I want by
using the workers.properties file, but that file seems to have no
effect on the system behavior. I wonder if it was written before
mod_proxy became a replacement for mod_jk.
_http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
No matter what I do, if I shut down Tomcat6A, there is no failover
behavior. Existing Tomcat6A request fail (expected) and new requests
fail with 404. Only the existing Tomcat6B request continue.
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
env=BALANCER_ROUTE_CHANGED
<Proxy balancer://cluster>
BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009 route=Tomcat6A
BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009 route=Tomcat6B
ProxySet stickysession=ROUTEID
</Proxy>
ProxyPass / balancer://cluster/
ProxyPassReverse / balancer://cluster/
The configuration above alternates between each tomcat as request come
in, which is not what I want.
I created a workers.properties file in /etc/httpd/conf/, based on the
loadBalance Howto, but it does not seem to have any effect on the
system. Does mod_proxy use it?
worker.list=balance1
# The load balancer worker balance1 will distribute
# load to the members Tomcat6A, Tomcat6B
worker.balance1.type=lb
worker.balance1.balance_workers=Tomcat6A, Tomcat6B
worker.Tomcat6A.type = ajp13
worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
worker.Tomcat6A.port = 8009
worker.Tomcat6A.redirect=Tomcat6B
#worker.Tomcat6A.lbfactor = 10
worker.Tomcat6B.type = ajp13
worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
worker.Tomcat6B.port = 8009
worker.Tomcat6B.activation=disabled
Each tomcat server.xml has
<Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6A">
or
<Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6B">
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by "Carter, Isaac" <Is...@ManTech.com>.
Ed,
Answer to #1...
I do not believe that mod_proxy uses the workers.properties file. I'm currently using mod_proxy and mod_ajp successfully without using the workers.properties file. I'm using them in place of mod_jk, which does use the workers.properties file.
Answer to #2...
Have you tried looking into mod_rewrite any? You may need to redirect the request to Tomcat6B once A has failed. This should be made possible
Through mod_rewrite and setting up the rewrite conditions and rules in the httpd.conf.
-Isaac
-----Original Message-----
From: Ed Young [mailto:ejy@summitbid.com]
Sent: Thursday, August 30, 2012 9:14 PM
To: users@httpd.apache.org
Subject: [users@httpd] Apache + 2 tomcat appserver failover configuration
I've set up a load balancing configuration based on an Apache server
and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
that Tomcat6B is a failover server, so if Tomcat6A goes down, Tomcat6B
will handle all subsequent requests.
I have two questions:
1. Does mod_proxy use the workers.properties file? It doesn't seem to
make any difference what is in workers.properties.
2. How can I set this system up for a failover configuration?
This is killing me. I'm using mod_proxy, mod_proxy_balancer, mod_ajp.
In the load balancer howto, it specifies the configuration I want by
using the workers.properties file, but that file seems to have no
effect on the system behavior. I wonder if it was written before
mod_proxy became a replacement for mod_jk.
_http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
No matter what I do, if I shut down Tomcat6A, there is no failover
behavior. Existing Tomcat6A request fail (expected) and new requests
fail with 404. Only the existing Tomcat6B request continue.
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
env=BALANCER_ROUTE_CHANGED
<Proxy balancer://cluster>
BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009 route=Tomcat6A
BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009 route=Tomcat6B
ProxySet stickysession=ROUTEID
</Proxy>
ProxyPass / balancer://cluster/
ProxyPassReverse / balancer://cluster/
The configuration above alternates between each tomcat as request come
in, which is not what I want.
I created a workers.properties file in /etc/httpd/conf/, based on the
loadBalance Howto, but it does not seem to have any effect on the
system. Does mod_proxy use it?
worker.list=balance1
# The load balancer worker balance1 will distribute
# load to the members Tomcat6A, Tomcat6B
worker.balance1.type=lb
worker.balance1.balance_workers=Tomcat6A, Tomcat6B
worker.Tomcat6A.type = ajp13
worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
worker.Tomcat6A.port = 8009
worker.Tomcat6A.redirect=Tomcat6B
#worker.Tomcat6A.lbfactor = 10
worker.Tomcat6B.type = ajp13
worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
worker.Tomcat6B.port = 8009
worker.Tomcat6B.activation=disabled
Each tomcat server.xml has
<Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6A">
or
<Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6B">
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Ed Young <ej...@summitbid.com>.
Thanks for the replies.
Yes, I decided to go with mod_jk rather than mod_proxy because there
is more experience with mod_jk at our company. I've now got the system
nearly fully configured for ssh, failover, etc.
Thanks for the notes on jkmanager. I've also got that working as well.
Very happy with the configuration at the moment.
On Sun, Sep 2, 2012 at 8:39 PM, Igor Cicimov <ic...@gmail.com> wrote:
> On Sun, Sep 2, 2012 at 3:29 PM, Daniel Ruggeri <DR...@primary.net> wrote:
>>
>> On 8/31/2012 6:08 PM, Ed Young wrote:
>>
>> I now need to get the urls for the /admin/jkmanager or
>> /balancer-manager working. Currently they are yielding 404.
>>
>>
>> I didn't see this in your configuration, but you have to enable the
>> balancer manager explicitly:
>>
>> <Location /balancer-manager>
>> SetHandler balancer-manager
>> Order deny,allow
>> Deny from all
>> Allow from 192.168
>> </Location>
>>
>> --
>> Daniel Ruggeri
>
>
> Not if using mod_jk and although not specifically mentioned by the OP I
> assume that's the path he has chosen for the failover/balancing. So the
> mod_proxy_balancer statements should have been removed from the apache
> config since you can use one module or the other (meaning mod_jk or
> mod_balancer) but not both of them together.
>
> The manager will be accessible via following setting in mod_jk:
>
> JkMount /jkmanager/* jkstatus
>
> so the OP needs to create another worker named jkstatus of type status in
> the worker.properties file. This is described in more details in the Apache
> Tomcat Connector Reference Guide, workers.properties section.
>
> Igor
--
- Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Igor Cicimov <ic...@gmail.com>.
On Sun, Sep 2, 2012 at 3:29 PM, Daniel Ruggeri <DR...@primary.net> wrote:
> On 8/31/2012 6:08 PM, Ed Young wrote:
>
> I now need to get the urls for the /admin/jkmanager or
> /balancer-manager working. Currently they are yielding 404.
>
>
> I didn't see this in your configuration, but you have to enable the
> balancer manager explicitly:
>
> <Location /balancer-manager>
> SetHandler balancer-manager
> Order deny,allow
> Deny from all
> Allow from 192.168
> </Location>
>
> --
> Daniel Ruggeri
>
>
Not if using mod_jk and although not specifically mentioned by the OP I
assume that's the path he has chosen for the failover/balancing. So the
mod_proxy_balancer statements should have been removed from the apache
config since you can use one module or the other (meaning mod_jk or
mod_balancer) but not both of them together.
The manager will be accessible via following setting in mod_jk:
JkMount /jkmanager/* jkstatus
so the OP needs to create another worker named jkstatus of type status in
the worker.properties file. This is described in more details in the Apache
Tomcat Connector Reference Guide, workers.properties section.
Igor
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Daniel Ruggeri <DR...@primary.net>.
On 8/31/2012 6:08 PM, Ed Young wrote:
> I now need to get the urls for the /admin/jkmanager or
> /balancer-manager working. Currently they are yielding 404.
I didn't see this in your configuration, but you have to enable the
balancer manager explicitly:
<Location /balancer-manager>
SetHandler balancer-manager
Order deny,allow
Deny from all
Allow from 192.168
</Location>
--
Daniel Ruggeri
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Ed Young <ej...@summitbid.com>.
Yes, I realized I put the jk_module descriptor in the wrong file
seconds after I sent this off.
I've now gotten failover working the way I need it to so thanks for the help.
I now need to get the urls for the /admin/jkmanager or
/balancer-manager working. Currently they are yielding 404.
Thanks again.
On Fri, Aug 31, 2012 at 10:35 AM, Igor Cicimov <ic...@gmail.com> wrote:
>
> On Sep 1, 2012 2:23 AM, "Ed Young" <ej...@summitbid.com> wrote:
>>
>> Thanks again for the reply. I believe the cluster descriptor in
>> httpd.conf describes the tomcat cluster, no? See below.
>>
>> I was able to install httpd-devel by hand and build and install
>> mod_jk, so I'm ready to take a shot at configuring cluster failover
>> using mod_jk.
>>
>> I've added the jk_module descriptor you suggested to my
>> conf/workers.properties file, but so far no luck getting it to
>> properly failover:
>>
>> worker.list=balance1
>>
>> # The load balancer worker balance1 will distribute
>> # load to the members Tomcat6A, Tomcat6B
>> worker.balance1.type=lb
>> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
>>
>> worker.Tomcat6A.type = ajp13
>> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
>> worker.Tomcat6A.port = 8009
>> worker.Tomcat6A.redirect=Tomcat6B
>> #worker.Tomcat6A.lbfactor = 10
>>
>> worker.Tomcat6B.type = ajp13
>> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
>> worker.Tomcat6B.port = 8009
>> worker.Tomcat6B.activation=disabled
>> #worker.Tomcat6B.lbfactor = 10
>>
>> #worker.stat1.type = status
>>
>
> You need to put this in the apache config file not the workers file.
>
>> <IfModule jk_module>
>> JkWorkersFile conf/workers.properties
>> JkLogFile "|/usr/local/apache2/bin/rotatelogs
>> /usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
>> JkLogLevel Debug
>> JKShmSize 256
>> JkShmFile logs/jk.shm
>> JkMount /* balance1
>> JkMount /jkmanager/* jkstatus
>> </IfModule>
>
>> The httpd.conf descriptor is basically this:
>>
>> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
>> env=BALANCER_ROUTE_CHANGED
>> <Proxy balancer://cluster>
>> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
>> route=Tomcat6A
>> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
>> route=Tomcat6B status=+H
>> # ProxySet lbmethod=byrequests
>> # ProxySet lbmethod=bytraffic
>> ProxySet stickysession=ROUTEID nofailover=Off lbmethod=bytraffic
>>
>> </Proxy>
>> ProxyPass / balancer://cluster/
>> ProxyPassReverse / balancer://cluster/
>>
>> ...but so far no luck.
>>
>> On Fri, Aug 31, 2012 at 10:19 AM, Igor Cicimov <ic...@gmail.com> wrote:
>> >
>> > On Sep 1, 2012 1:38 AM, "Ed Young" <ej...@summitbid.com> wrote:
>> >>
>> >> Thanks for the reply.
>> >>
>> >> On Fri, Aug 31, 2012 at 12:10 AM, Igor Cicimov <ic...@gmail.com>
>> >> wrote:
>> >> > On Fri, Aug 31, 2012 at 11:13 AM, Ed Young <ej...@summitbid.com> wrote:
>> >> >>
>> >> >> I've set up a load balancing configuration based on an Apache server
>> >> >> and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
>> >> >> that Tomcat6B is a failover server, so if Tomcat6A goes down,
>> >> >> Tomcat6B
>> >> >> will handle all subsequent requests.
>> >> >>
>> >> >
>> >> > This is a hot standby scenario. IMHO the best is to use mod_jk
>> >> > instead.
>> >> >
>> >> > Example of mod_jk config for your workers.properties file:
>> >> >
>> >> > <IfModule jk_module>
>> >> > JkWorkersFile conf/workers.properties
>> >> > JkLogFile "|/usr/local/apache2/bin/rotatelogs
>> >> > /usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
>> >> > JkLogLevel Debug
>> >> > JKShmSize 256
>> >> > JkShmFile logs/jk.shm
>> >> > JkMount /* balance1
>> >> > JkMount /jkmanager/* jkstatus
>> >> > </IfModule>
>> >> >
>> >> > but from your post I'm not sure if you have mod_jk installed and
>> >> > configured
>> >> > at all.
>> >>
>> >> No, mod_jk not installed and this Linux installation has a number of
>> >> factors that keep me from building and installing mod_jk
>> >> No apxs
>> >> No APR
>> >> Misconfigured corporate rpm repository which keeps me from installing
>> >> httpd-devel and thereby pursuing mod_jk. Hopefully this will be
>> >> corrected soon.
>> >>
>> >> My understanding is that mod_proxy replaces mod_jk, but i haven't had
>> >> any success getting mod_proxy to work in a failover scenario, so I may
>> >> be stuck for now.
>> >>
>> >> >
>> >> > What you want to achive means that when the balancer worker on
>> >> > Tomcat6A
>> >> > is
>> >> > in error state, the balancer will redirect the sessions to Tomcat6B.
>> >> > This
>> >> > also means though that that user session should exist on Tomcat6B too
>> >> > which
>> >> > on other hand means you need to have some kind of session replication
>> >> > between tomcat servers. I haven't seen your full tomcat config but
>> >> > hope
>> >> > you
>> >> > have cluster set up or the fail over will not work.
>> >> >
>> >>
>> >> I have a cluster set up, but no session replication. My requirement is
>> >> that if Tomcat6A goes down, we will lose any sessions, but all new
>> >> sessions will failover to Tomcat6B
>> >>
>> >> The <Proxy balancer://cluster> descriptor below defines my cluster
>> >> settup,
>> >> no?
>> >
>> > No. Im talking about cluster of tomcat servers not your balancer name.
>> >
>> >> >>
>> >> >> I have two questions:
>> >> >> 1. Does mod_proxy use the workers.properties file? It doesn't seem
>> >> >> to
>> >> >> make any difference what is in workers.properties.
>> >> >> 2. How can I set this system up for a failover configuration?
>> >> >>
>> >> >> This is killing me. I'm using mod_proxy, mod_proxy_balancer,
>> >> >> mod_ajp.
>> >> >>
>> >> >> In the load balancer howto, it specifies the configuration I want by
>> >> >> using the workers.properties file, but that file seems to have no
>> >> >> effect on the system behavior. I wonder if it was written before
>> >> >> mod_proxy became a replacement for mod_jk.
>> >> >>
>> >> >>
>> >> >> _http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
>> >> >>
>> >> >> No matter what I do, if I shut down Tomcat6A, there is no failover
>> >> >> behavior. Existing Tomcat6A request fail (expected) and new requests
>> >> >> fail with 404. Only the existing Tomcat6B request continue.
>> >> >>
>> >> >> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
>> >> >> env=BALANCER_ROUTE_CHANGED
>> >> >> <Proxy balancer://cluster>
>> >> >> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
>> >> >> route=Tomcat6A
>> >> >> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
>> >> >> route=Tomcat6B
>> >> >> ProxySet stickysession=ROUTEID
>> >> >> </Proxy>
>> >> >>
>> >> >> ProxyPass / balancer://cluster/
>> >> >> ProxyPassReverse / balancer://cluster/
>> >> >>
>> >> >
>> >> > For mod_proxy_balancer (if you insist), I would put something like
>> >> > this:
>> >> >
>> >> >
>> >> > <Proxy balancer://cluster>
>> >> > BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
>> >> > route=Tomcat6A
>> >> > BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
>> >> > route=Tomcat6B status=+H
>> >> > ProxySet stickysession=ROUTEID nofailover=Off
>> >> > lbmethod=bytraffic
>> >> > </Proxy>
>> >> >
>> >> > This puts Tomcat6B worker in hot backup state and the whole traffic
>> >> > is
>> >> > redirected to Tomcat6A. Per my understanding, the above configuration
>> >> > means
>> >> > that when the balancer worker on Tomcat6A is in error state, the
>> >> > balancer
>> >> > will redirect the session to Tomcat6B which is marked as hot backup .
>> >> > The
>> >> > tomcat session replication remark is valid in this scenario too.
>> >> >
>> >>
>> >> I tried this (thanks) and I'm afraid that it does not work. When
>> >> Tomcat6A goes down, it does not route new traffic to Tomcat6B
>> >
>> > Then look at your logs on both sides and check what is not working.
>> >
>> >>
>> >> I wonder if there is anyone who has successfully configured a cluster
>> >> failover using mod_proxy?
>> >>
>> >> >
>> >> >> The configuration above alternates between each tomcat as request
>> >> >> come
>> >> >> in, which is not what I want.
>> >> >>
>> >> >> I created a workers.properties file in /etc/httpd/conf/, based on
>> >> >> the
>> >> >> loadBalance Howto, but it does not seem to have any effect on the
>> >> >> system. Does mod_proxy use it?
>> >> >>
>> >> >> worker.list=balance1
>> >> >>
>> >> >> # The load balancer worker balance1 will distribute
>> >> >> # load to the members Tomcat6A, Tomcat6B
>> >> >> worker.balance1.type=lb
>> >> >> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
>> >> >>
>> >> >> worker.Tomcat6A.type = ajp13
>> >> >> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
>> >> >> worker.Tomcat6A.port = 8009
>> >> >> worker.Tomcat6A.redirect=Tomcat6B
>> >> >> #worker.Tomcat6A.lbfactor = 10
>> >> >>
>> >> >> worker.Tomcat6B.type = ajp13
>> >> >> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
>> >> >> worker.Tomcat6B.port = 8009
>> >> >> worker.Tomcat6B.activation=disabled
>> >> >>
>> >> >> Each tomcat server.xml has
>> >> >> <Engine name="Standalone" defaultHost="localhost"
>> >> >> jvmRoute="Tomcat6A">
>> >> >> or
>> >> >> <Engine name="Standalone" defaultHost="localhost"
>> >> >> jvmRoute="Tomcat6B">
>> >> >>
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> >> >> For additional commands, e-mail: users-help@httpd.apache.org
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> - Ed
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> >> For additional commands, e-mail: users-help@httpd.apache.org
>> >>
>>
>>
>>
>> --
>> - Ed
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
--
- Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Igor Cicimov <ic...@gmail.com>.
On Sep 1, 2012 2:23 AM, "Ed Young" <ej...@summitbid.com> wrote:
>
> Thanks again for the reply. I believe the cluster descriptor in
> httpd.conf describes the tomcat cluster, no? See below.
>
> I was able to install httpd-devel by hand and build and install
> mod_jk, so I'm ready to take a shot at configuring cluster failover
> using mod_jk.
>
> I've added the jk_module descriptor you suggested to my
> conf/workers.properties file, but so far no luck getting it to
> properly failover:
>
> worker.list=balance1
>
> # The load balancer worker balance1 will distribute
> # load to the members Tomcat6A, Tomcat6B
> worker.balance1.type=lb
> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
>
> worker.Tomcat6A.type = ajp13
> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
> worker.Tomcat6A.port = 8009
> worker.Tomcat6A.redirect=Tomcat6B
> #worker.Tomcat6A.lbfactor = 10
>
> worker.Tomcat6B.type = ajp13
> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
> worker.Tomcat6B.port = 8009
> worker.Tomcat6B.activation=disabled
> #worker.Tomcat6B.lbfactor = 10
>
> #worker.stat1.type = status
>
You need to put this in the apache config file not the workers file.
> <IfModule jk_module>
> JkWorkersFile conf/workers.properties
> JkLogFile "|/usr/local/apache2/bin/rotatelogs
> /usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
> JkLogLevel Debug
> JKShmSize 256
> JkShmFile logs/jk.shm
> JkMount /* balance1
> JkMount /jkmanager/* jkstatus
> </IfModule>
> The httpd.conf descriptor is basically this:
>
> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
> env=BALANCER_ROUTE_CHANGED
> <Proxy balancer://cluster>
> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009route=Tomcat6A
> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009route=Tomcat6B status=+H
> # ProxySet lbmethod=byrequests
> # ProxySet lbmethod=bytraffic
> ProxySet stickysession=ROUTEID nofailover=Off lbmethod=bytraffic
>
> </Proxy>
> ProxyPass / balancer://cluster/
> ProxyPassReverse / balancer://cluster/
>
> ...but so far no luck.
>
> On Fri, Aug 31, 2012 at 10:19 AM, Igor Cicimov <ic...@gmail.com> wrote:
> >
> > On Sep 1, 2012 1:38 AM, "Ed Young" <ej...@summitbid.com> wrote:
> >>
> >> Thanks for the reply.
> >>
> >> On Fri, Aug 31, 2012 at 12:10 AM, Igor Cicimov <ic...@gmail.com>
wrote:
> >> > On Fri, Aug 31, 2012 at 11:13 AM, Ed Young <ej...@summitbid.com> wrote:
> >> >>
> >> >> I've set up a load balancing configuration based on an Apache server
> >> >> and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
> >> >> that Tomcat6B is a failover server, so if Tomcat6A goes down,
Tomcat6B
> >> >> will handle all subsequent requests.
> >> >>
> >> >
> >> > This is a hot standby scenario. IMHO the best is to use mod_jk
instead.
> >> >
> >> > Example of mod_jk config for your workers.properties file:
> >> >
> >> > <IfModule jk_module>
> >> > JkWorkersFile conf/workers.properties
> >> > JkLogFile "|/usr/local/apache2/bin/rotatelogs
> >> > /usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
> >> > JkLogLevel Debug
> >> > JKShmSize 256
> >> > JkShmFile logs/jk.shm
> >> > JkMount /* balance1
> >> > JkMount /jkmanager/* jkstatus
> >> > </IfModule>
> >> >
> >> > but from your post I'm not sure if you have mod_jk installed and
> >> > configured
> >> > at all.
> >>
> >> No, mod_jk not installed and this Linux installation has a number of
> >> factors that keep me from building and installing mod_jk
> >> No apxs
> >> No APR
> >> Misconfigured corporate rpm repository which keeps me from installing
> >> httpd-devel and thereby pursuing mod_jk. Hopefully this will be
> >> corrected soon.
> >>
> >> My understanding is that mod_proxy replaces mod_jk, but i haven't had
> >> any success getting mod_proxy to work in a failover scenario, so I may
> >> be stuck for now.
> >>
> >> >
> >> > What you want to achive means that when the balancer worker on
Tomcat6A
> >> > is
> >> > in error state, the balancer will redirect the sessions to Tomcat6B.
> >> > This
> >> > also means though that that user session should exist on Tomcat6B too
> >> > which
> >> > on other hand means you need to have some kind of session replication
> >> > between tomcat servers. I haven't seen your full tomcat config but
hope
> >> > you
> >> > have cluster set up or the fail over will not work.
> >> >
> >>
> >> I have a cluster set up, but no session replication. My requirement is
> >> that if Tomcat6A goes down, we will lose any sessions, but all new
> >> sessions will failover to Tomcat6B
> >>
> >> The <Proxy balancer://cluster> descriptor below defines my cluster
settup,
> >> no?
> >
> > No. Im talking about cluster of tomcat servers not your balancer name.
> >
> >> >>
> >> >> I have two questions:
> >> >> 1. Does mod_proxy use the workers.properties file? It doesn't seem
to
> >> >> make any difference what is in workers.properties.
> >> >> 2. How can I set this system up for a failover configuration?
> >> >>
> >> >> This is killing me. I'm using mod_proxy, mod_proxy_balancer,
mod_ajp.
> >> >>
> >> >> In the load balancer howto, it specifies the configuration I want by
> >> >> using the workers.properties file, but that file seems to have no
> >> >> effect on the system behavior. I wonder if it was written before
> >> >> mod_proxy became a replacement for mod_jk.
> >> >>
> >> >> _
http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
> >> >>
> >> >> No matter what I do, if I shut down Tomcat6A, there is no failover
> >> >> behavior. Existing Tomcat6A request fail (expected) and new requests
> >> >> fail with 404. Only the existing Tomcat6B request continue.
> >> >>
> >> >> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
> >> >> env=BALANCER_ROUTE_CHANGED
> >> >> <Proxy balancer://cluster>
> >> >> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
> >> >> route=Tomcat6A
> >> >> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
> >> >> route=Tomcat6B
> >> >> ProxySet stickysession=ROUTEID
> >> >> </Proxy>
> >> >>
> >> >> ProxyPass / balancer://cluster/
> >> >> ProxyPassReverse / balancer://cluster/
> >> >>
> >> >
> >> > For mod_proxy_balancer (if you insist), I would put something like
this:
> >> >
> >> >
> >> > <Proxy balancer://cluster>
> >> > BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
> >> > route=Tomcat6A
> >> > BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
> >> > route=Tomcat6B status=+H
> >> > ProxySet stickysession=ROUTEID nofailover=Off
lbmethod=bytraffic
> >> > </Proxy>
> >> >
> >> > This puts Tomcat6B worker in hot backup state and the whole traffic
is
> >> > redirected to Tomcat6A. Per my understanding, the above configuration
> >> > means
> >> > that when the balancer worker on Tomcat6A is in error state, the
> >> > balancer
> >> > will redirect the session to Tomcat6B which is marked as hot backup .
> >> > The
> >> > tomcat session replication remark is valid in this scenario too.
> >> >
> >>
> >> I tried this (thanks) and I'm afraid that it does not work. When
> >> Tomcat6A goes down, it does not route new traffic to Tomcat6B
> >
> > Then look at your logs on both sides and check what is not working.
> >
> >>
> >> I wonder if there is anyone who has successfully configured a cluster
> >> failover using mod_proxy?
> >>
> >> >
> >> >> The configuration above alternates between each tomcat as request
come
> >> >> in, which is not what I want.
> >> >>
> >> >> I created a workers.properties file in /etc/httpd/conf/, based on
the
> >> >> loadBalance Howto, but it does not seem to have any effect on the
> >> >> system. Does mod_proxy use it?
> >> >>
> >> >> worker.list=balance1
> >> >>
> >> >> # The load balancer worker balance1 will distribute
> >> >> # load to the members Tomcat6A, Tomcat6B
> >> >> worker.balance1.type=lb
> >> >> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
> >> >>
> >> >> worker.Tomcat6A.type = ajp13
> >> >> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
> >> >> worker.Tomcat6A.port = 8009
> >> >> worker.Tomcat6A.redirect=Tomcat6B
> >> >> #worker.Tomcat6A.lbfactor = 10
> >> >>
> >> >> worker.Tomcat6B.type = ajp13
> >> >> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
> >> >> worker.Tomcat6B.port = 8009
> >> >> worker.Tomcat6B.activation=disabled
> >> >>
> >> >> Each tomcat server.xml has
> >> >> <Engine name="Standalone" defaultHost="localhost"
jvmRoute="Tomcat6A">
> >> >> or
> >> >> <Engine name="Standalone" defaultHost="localhost"
jvmRoute="Tomcat6B">
> >> >>
> >> >>
---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >> >> For additional commands, e-mail: users-help@httpd.apache.org
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> - Ed
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >> For additional commands, e-mail: users-help@httpd.apache.org
> >>
>
>
>
> --
> - Ed
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Ed Young <ej...@summitbid.com>.
Thanks again for the reply. I believe the cluster descriptor in
httpd.conf describes the tomcat cluster, no? See below.
I was able to install httpd-devel by hand and build and install
mod_jk, so I'm ready to take a shot at configuring cluster failover
using mod_jk.
I've added the jk_module descriptor you suggested to my
conf/workers.properties file, but so far no luck getting it to
properly failover:
worker.list=balance1
# The load balancer worker balance1 will distribute
# load to the members Tomcat6A, Tomcat6B
worker.balance1.type=lb
worker.balance1.balance_workers=Tomcat6A, Tomcat6B
worker.Tomcat6A.type = ajp13
worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
worker.Tomcat6A.port = 8009
worker.Tomcat6A.redirect=Tomcat6B
#worker.Tomcat6A.lbfactor = 10
worker.Tomcat6B.type = ajp13
worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
worker.Tomcat6B.port = 8009
worker.Tomcat6B.activation=disabled
#worker.Tomcat6B.lbfactor = 10
#worker.stat1.type = status
<IfModule jk_module>
JkWorkersFile conf/workers.properties
JkLogFile "|/usr/local/apache2/bin/rotatelogs
/usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
JkLogLevel Debug
JKShmSize 256
JkShmFile logs/jk.shm
JkMount /* balance1
JkMount /jkmanager/* jkstatus
</IfModule>
The httpd.conf descriptor is basically this:
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
env=BALANCER_ROUTE_CHANGED
<Proxy balancer://cluster>
BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009 route=Tomcat6A
BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009 route=Tomcat6B status=+H
# ProxySet lbmethod=byrequests
# ProxySet lbmethod=bytraffic
ProxySet stickysession=ROUTEID nofailover=Off lbmethod=bytraffic
</Proxy>
ProxyPass / balancer://cluster/
ProxyPassReverse / balancer://cluster/
...but so far no luck.
On Fri, Aug 31, 2012 at 10:19 AM, Igor Cicimov <ic...@gmail.com> wrote:
>
> On Sep 1, 2012 1:38 AM, "Ed Young" <ej...@summitbid.com> wrote:
>>
>> Thanks for the reply.
>>
>> On Fri, Aug 31, 2012 at 12:10 AM, Igor Cicimov <ic...@gmail.com> wrote:
>> > On Fri, Aug 31, 2012 at 11:13 AM, Ed Young <ej...@summitbid.com> wrote:
>> >>
>> >> I've set up a load balancing configuration based on an Apache server
>> >> and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
>> >> that Tomcat6B is a failover server, so if Tomcat6A goes down, Tomcat6B
>> >> will handle all subsequent requests.
>> >>
>> >
>> > This is a hot standby scenario. IMHO the best is to use mod_jk instead.
>> >
>> > Example of mod_jk config for your workers.properties file:
>> >
>> > <IfModule jk_module>
>> > JkWorkersFile conf/workers.properties
>> > JkLogFile "|/usr/local/apache2/bin/rotatelogs
>> > /usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
>> > JkLogLevel Debug
>> > JKShmSize 256
>> > JkShmFile logs/jk.shm
>> > JkMount /* balance1
>> > JkMount /jkmanager/* jkstatus
>> > </IfModule>
>> >
>> > but from your post I'm not sure if you have mod_jk installed and
>> > configured
>> > at all.
>>
>> No, mod_jk not installed and this Linux installation has a number of
>> factors that keep me from building and installing mod_jk
>> No apxs
>> No APR
>> Misconfigured corporate rpm repository which keeps me from installing
>> httpd-devel and thereby pursuing mod_jk. Hopefully this will be
>> corrected soon.
>>
>> My understanding is that mod_proxy replaces mod_jk, but i haven't had
>> any success getting mod_proxy to work in a failover scenario, so I may
>> be stuck for now.
>>
>> >
>> > What you want to achive means that when the balancer worker on Tomcat6A
>> > is
>> > in error state, the balancer will redirect the sessions to Tomcat6B.
>> > This
>> > also means though that that user session should exist on Tomcat6B too
>> > which
>> > on other hand means you need to have some kind of session replication
>> > between tomcat servers. I haven't seen your full tomcat config but hope
>> > you
>> > have cluster set up or the fail over will not work.
>> >
>>
>> I have a cluster set up, but no session replication. My requirement is
>> that if Tomcat6A goes down, we will lose any sessions, but all new
>> sessions will failover to Tomcat6B
>>
>> The <Proxy balancer://cluster> descriptor below defines my cluster settup,
>> no?
>
> No. Im talking about cluster of tomcat servers not your balancer name.
>
>> >>
>> >> I have two questions:
>> >> 1. Does mod_proxy use the workers.properties file? It doesn't seem to
>> >> make any difference what is in workers.properties.
>> >> 2. How can I set this system up for a failover configuration?
>> >>
>> >> This is killing me. I'm using mod_proxy, mod_proxy_balancer, mod_ajp.
>> >>
>> >> In the load balancer howto, it specifies the configuration I want by
>> >> using the workers.properties file, but that file seems to have no
>> >> effect on the system behavior. I wonder if it was written before
>> >> mod_proxy became a replacement for mod_jk.
>> >>
>> >> _http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
>> >>
>> >> No matter what I do, if I shut down Tomcat6A, there is no failover
>> >> behavior. Existing Tomcat6A request fail (expected) and new requests
>> >> fail with 404. Only the existing Tomcat6B request continue.
>> >>
>> >> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
>> >> env=BALANCER_ROUTE_CHANGED
>> >> <Proxy balancer://cluster>
>> >> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
>> >> route=Tomcat6A
>> >> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
>> >> route=Tomcat6B
>> >> ProxySet stickysession=ROUTEID
>> >> </Proxy>
>> >>
>> >> ProxyPass / balancer://cluster/
>> >> ProxyPassReverse / balancer://cluster/
>> >>
>> >
>> > For mod_proxy_balancer (if you insist), I would put something like this:
>> >
>> >
>> > <Proxy balancer://cluster>
>> > BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
>> > route=Tomcat6A
>> > BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
>> > route=Tomcat6B status=+H
>> > ProxySet stickysession=ROUTEID nofailover=Off lbmethod=bytraffic
>> > </Proxy>
>> >
>> > This puts Tomcat6B worker in hot backup state and the whole traffic is
>> > redirected to Tomcat6A. Per my understanding, the above configuration
>> > means
>> > that when the balancer worker on Tomcat6A is in error state, the
>> > balancer
>> > will redirect the session to Tomcat6B which is marked as hot backup .
>> > The
>> > tomcat session replication remark is valid in this scenario too.
>> >
>>
>> I tried this (thanks) and I'm afraid that it does not work. When
>> Tomcat6A goes down, it does not route new traffic to Tomcat6B
>
> Then look at your logs on both sides and check what is not working.
>
>>
>> I wonder if there is anyone who has successfully configured a cluster
>> failover using mod_proxy?
>>
>> >
>> >> The configuration above alternates between each tomcat as request come
>> >> in, which is not what I want.
>> >>
>> >> I created a workers.properties file in /etc/httpd/conf/, based on the
>> >> loadBalance Howto, but it does not seem to have any effect on the
>> >> system. Does mod_proxy use it?
>> >>
>> >> worker.list=balance1
>> >>
>> >> # The load balancer worker balance1 will distribute
>> >> # load to the members Tomcat6A, Tomcat6B
>> >> worker.balance1.type=lb
>> >> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
>> >>
>> >> worker.Tomcat6A.type = ajp13
>> >> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
>> >> worker.Tomcat6A.port = 8009
>> >> worker.Tomcat6A.redirect=Tomcat6B
>> >> #worker.Tomcat6A.lbfactor = 10
>> >>
>> >> worker.Tomcat6B.type = ajp13
>> >> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
>> >> worker.Tomcat6B.port = 8009
>> >> worker.Tomcat6B.activation=disabled
>> >>
>> >> Each tomcat server.xml has
>> >> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6A">
>> >> or
>> >> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6B">
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> >> For additional commands, e-mail: users-help@httpd.apache.org
>> >>
>> >
>> >
>> >
>> >
>> >
>>
>>
>>
>> --
>> - Ed
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
--
- Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Igor Cicimov <ic...@gmail.com>.
On Sep 1, 2012 1:38 AM, "Ed Young" <ej...@summitbid.com> wrote:
>
> Thanks for the reply.
>
> On Fri, Aug 31, 2012 at 12:10 AM, Igor Cicimov <ic...@gmail.com> wrote:
> > On Fri, Aug 31, 2012 at 11:13 AM, Ed Young <ej...@summitbid.com> wrote:
> >>
> >> I've set up a load balancing configuration based on an Apache server
> >> and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
> >> that Tomcat6B is a failover server, so if Tomcat6A goes down, Tomcat6B
> >> will handle all subsequent requests.
> >>
> >
> > This is a hot standby scenario. IMHO the best is to use mod_jk instead.
> >
> > Example of mod_jk config for your workers.properties file:
> >
> > <IfModule jk_module>
> > JkWorkersFile conf/workers.properties
> > JkLogFile "|/usr/local/apache2/bin/rotatelogs
> > /usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
> > JkLogLevel Debug
> > JKShmSize 256
> > JkShmFile logs/jk.shm
> > JkMount /* balance1
> > JkMount /jkmanager/* jkstatus
> > </IfModule>
> >
> > but from your post I'm not sure if you have mod_jk installed and
configured
> > at all.
>
> No, mod_jk not installed and this Linux installation has a number of
> factors that keep me from building and installing mod_jk
> No apxs
> No APR
> Misconfigured corporate rpm repository which keeps me from installing
> httpd-devel and thereby pursuing mod_jk. Hopefully this will be
> corrected soon.
>
> My understanding is that mod_proxy replaces mod_jk, but i haven't had
> any success getting mod_proxy to work in a failover scenario, so I may
> be stuck for now.
>
> >
> > What you want to achive means that when the balancer worker on Tomcat6A
is
> > in error state, the balancer will redirect the sessions to Tomcat6B.
This
> > also means though that that user session should exist on Tomcat6B too
which
> > on other hand means you need to have some kind of session replication
> > between tomcat servers. I haven't seen your full tomcat config but hope
you
> > have cluster set up or the fail over will not work.
> >
>
> I have a cluster set up, but no session replication. My requirement is
> that if Tomcat6A goes down, we will lose any sessions, but all new
> sessions will failover to Tomcat6B
>
> The <Proxy balancer://cluster> descriptor below defines my cluster
settup, no?
No. Im talking about cluster of tomcat servers not your balancer name.
> >>
> >> I have two questions:
> >> 1. Does mod_proxy use the workers.properties file? It doesn't seem to
> >> make any difference what is in workers.properties.
> >> 2. How can I set this system up for a failover configuration?
> >>
> >> This is killing me. I'm using mod_proxy, mod_proxy_balancer, mod_ajp.
> >>
> >> In the load balancer howto, it specifies the configuration I want by
> >> using the workers.properties file, but that file seems to have no
> >> effect on the system behavior. I wonder if it was written before
> >> mod_proxy became a replacement for mod_jk.
> >> _
http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
> >>
> >> No matter what I do, if I shut down Tomcat6A, there is no failover
> >> behavior. Existing Tomcat6A request fail (expected) and new requests
> >> fail with 404. Only the existing Tomcat6B request continue.
> >>
> >> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
> >> env=BALANCER_ROUTE_CHANGED
> >> <Proxy balancer://cluster>
> >> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
> >> route=Tomcat6A
> >> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
> >> route=Tomcat6B
> >> ProxySet stickysession=ROUTEID
> >> </Proxy>
> >>
> >> ProxyPass / balancer://cluster/
> >> ProxyPassReverse / balancer://cluster/
> >>
> >
> > For mod_proxy_balancer (if you insist), I would put something like this:
> >
> >
> > <Proxy balancer://cluster>
> > BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
> > route=Tomcat6A
> > BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
> > route=Tomcat6B status=+H
> > ProxySet stickysession=ROUTEID nofailover=Off lbmethod=bytraffic
> > </Proxy>
> >
> > This puts Tomcat6B worker in hot backup state and the whole traffic is
> > redirected to Tomcat6A. Per my understanding, the above configuration
means
> > that when the balancer worker on Tomcat6A is in error state, the
balancer
> > will redirect the session to Tomcat6B which is marked as hot backup .
The
> > tomcat session replication remark is valid in this scenario too.
> >
>
> I tried this (thanks) and I'm afraid that it does not work. When
> Tomcat6A goes down, it does not route new traffic to Tomcat6B
Then look at your logs on both sides and check what is not working.
>
> I wonder if there is anyone who has successfully configured a cluster
> failover using mod_proxy?
>
> >
> >> The configuration above alternates between each tomcat as request come
> >> in, which is not what I want.
> >>
> >> I created a workers.properties file in /etc/httpd/conf/, based on the
> >> loadBalance Howto, but it does not seem to have any effect on the
> >> system. Does mod_proxy use it?
> >>
> >> worker.list=balance1
> >>
> >> # The load balancer worker balance1 will distribute
> >> # load to the members Tomcat6A, Tomcat6B
> >> worker.balance1.type=lb
> >> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
> >>
> >> worker.Tomcat6A.type = ajp13
> >> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
> >> worker.Tomcat6A.port = 8009
> >> worker.Tomcat6A.redirect=Tomcat6B
> >> #worker.Tomcat6A.lbfactor = 10
> >>
> >> worker.Tomcat6B.type = ajp13
> >> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
> >> worker.Tomcat6B.port = 8009
> >> worker.Tomcat6B.activation=disabled
> >>
> >> Each tomcat server.xml has
> >> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6A">
> >> or
> >> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6B">
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >> For additional commands, e-mail: users-help@httpd.apache.org
> >>
> >
> >
> >
> >
> >
>
>
>
> --
> - Ed
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Jim Jagielski <ji...@jaguNET.com>.
On Aug 31, 2012, at 11:37 AM, Ed Young <ej...@summitbid.com> wrote:
>
> My understanding is that mod_proxy replaces mod_jk, but i haven't had
> any success getting mod_proxy to work in a failover scenario, so I may
> be stuck for now.
>
mod_proxy's failover works fine... what problems are you seeing?
What version of httpd are you using?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Ed Young <ej...@summitbid.com>.
Thanks for the reply.
On Fri, Aug 31, 2012 at 12:10 AM, Igor Cicimov <ic...@gmail.com> wrote:
> On Fri, Aug 31, 2012 at 11:13 AM, Ed Young <ej...@summitbid.com> wrote:
>>
>> I've set up a load balancing configuration based on an Apache server
>> and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
>> that Tomcat6B is a failover server, so if Tomcat6A goes down, Tomcat6B
>> will handle all subsequent requests.
>>
>
> This is a hot standby scenario. IMHO the best is to use mod_jk instead.
>
> Example of mod_jk config for your workers.properties file:
>
> <IfModule jk_module>
> JkWorkersFile conf/workers.properties
> JkLogFile "|/usr/local/apache2/bin/rotatelogs
> /usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
> JkLogLevel Debug
> JKShmSize 256
> JkShmFile logs/jk.shm
> JkMount /* balance1
> JkMount /jkmanager/* jkstatus
> </IfModule>
>
> but from your post I'm not sure if you have mod_jk installed and configured
> at all.
No, mod_jk not installed and this Linux installation has a number of
factors that keep me from building and installing mod_jk
No apxs
No APR
Misconfigured corporate rpm repository which keeps me from installing
httpd-devel and thereby pursuing mod_jk. Hopefully this will be
corrected soon.
My understanding is that mod_proxy replaces mod_jk, but i haven't had
any success getting mod_proxy to work in a failover scenario, so I may
be stuck for now.
>
> What you want to achive means that when the balancer worker on Tomcat6A is
> in error state, the balancer will redirect the sessions to Tomcat6B. This
> also means though that that user session should exist on Tomcat6B too which
> on other hand means you need to have some kind of session replication
> between tomcat servers. I haven't seen your full tomcat config but hope you
> have cluster set up or the fail over will not work.
>
I have a cluster set up, but no session replication. My requirement is
that if Tomcat6A goes down, we will lose any sessions, but all new
sessions will failover to Tomcat6B
The <Proxy balancer://cluster> descriptor below defines my cluster settup, no?
>>
>> I have two questions:
>> 1. Does mod_proxy use the workers.properties file? It doesn't seem to
>> make any difference what is in workers.properties.
>> 2. How can I set this system up for a failover configuration?
>>
>> This is killing me. I'm using mod_proxy, mod_proxy_balancer, mod_ajp.
>>
>> In the load balancer howto, it specifies the configuration I want by
>> using the workers.properties file, but that file seems to have no
>> effect on the system behavior. I wonder if it was written before
>> mod_proxy became a replacement for mod_jk.
>> _http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
>>
>> No matter what I do, if I shut down Tomcat6A, there is no failover
>> behavior. Existing Tomcat6A request fail (expected) and new requests
>> fail with 404. Only the existing Tomcat6B request continue.
>>
>> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
>> env=BALANCER_ROUTE_CHANGED
>> <Proxy balancer://cluster>
>> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
>> route=Tomcat6A
>> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
>> route=Tomcat6B
>> ProxySet stickysession=ROUTEID
>> </Proxy>
>>
>> ProxyPass / balancer://cluster/
>> ProxyPassReverse / balancer://cluster/
>>
>
> For mod_proxy_balancer (if you insist), I would put something like this:
>
>
> <Proxy balancer://cluster>
> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009
> route=Tomcat6A
> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009
> route=Tomcat6B status=+H
> ProxySet stickysession=ROUTEID nofailover=Off lbmethod=bytraffic
> </Proxy>
>
> This puts Tomcat6B worker in hot backup state and the whole traffic is
> redirected to Tomcat6A. Per my understanding, the above configuration means
> that when the balancer worker on Tomcat6A is in error state, the balancer
> will redirect the session to Tomcat6B which is marked as hot backup . The
> tomcat session replication remark is valid in this scenario too.
>
I tried this (thanks) and I'm afraid that it does not work. When
Tomcat6A goes down, it does not route new traffic to Tomcat6B
I wonder if there is anyone who has successfully configured a cluster
failover using mod_proxy?
>
>> The configuration above alternates between each tomcat as request come
>> in, which is not what I want.
>>
>> I created a workers.properties file in /etc/httpd/conf/, based on the
>> loadBalance Howto, but it does not seem to have any effect on the
>> system. Does mod_proxy use it?
>>
>> worker.list=balance1
>>
>> # The load balancer worker balance1 will distribute
>> # load to the members Tomcat6A, Tomcat6B
>> worker.balance1.type=lb
>> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
>>
>> worker.Tomcat6A.type = ajp13
>> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
>> worker.Tomcat6A.port = 8009
>> worker.Tomcat6A.redirect=Tomcat6B
>> #worker.Tomcat6A.lbfactor = 10
>>
>> worker.Tomcat6B.type = ajp13
>> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
>> worker.Tomcat6B.port = 8009
>> worker.Tomcat6B.activation=disabled
>>
>> Each tomcat server.xml has
>> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6A">
>> or
>> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6B">
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>
>
>
>
>
--
- Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Igor Cicimov <ic...@gmail.com>.
On Fri, Aug 31, 2012 at 11:13 AM, Ed Young <ej...@summitbid.com> wrote:
> I've set up a load balancing configuration based on an Apache server
> and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
> that Tomcat6B is a failover server, so if Tomcat6A goes down, Tomcat6B
> will handle all subsequent requests.
>
>
This is a hot standby scenario. IMHO the best is to use mod_jk instead.
Example of mod_jk config for your workers.properties file:
<IfModule jk_module>
JkWorkersFile conf/workers.properties
JkLogFile "|/usr/local/apache2/bin/rotatelogs
/usr/local/apache2/logs/mod_jk.log.%Y%m%d 86400"
JkLogLevel Debug
JKShmSize 256
JkShmFile logs/jk.shm
JkMount /* balance1
JkMount /jkmanager/* jkstatus
</IfModule>
but from your post I'm not sure if you have mod_jk installed and configured
at all.
What you want to achive means that when the balancer worker on Tomcat6A is
in error state, the balancer will redirect the sessions to Tomcat6B. This
also means though that that user session should exist on Tomcat6B too which
on other hand means you need to have some kind of session replication
between tomcat servers. I haven't seen your full tomcat config but hope you
have cluster set up or the fail over will not work.
> I have two questions:
> 1. Does mod_proxy use the workers.properties file? It doesn't seem to
> make any difference what is in workers.properties.
> 2. How can I set this system up for a failover configuration?
>
> This is killing me. I'm using mod_proxy, mod_proxy_balancer, mod_ajp.
>
> In the load balancer howto, it specifies the configuration I want by
> using the workers.properties file, but that file seems to have no
> effect on the system behavior. I wonder if it was written before
> mod_proxy became a replacement for mod_jk.
> _http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
>
> No matter what I do, if I shut down Tomcat6A, there is no failover
> behavior. Existing Tomcat6A request fail (expected) and new requests
> fail with 404. Only the existing Tomcat6B request continue.
>
> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
> env=BALANCER_ROUTE_CHANGED
> <Proxy balancer://cluster>
> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009route=Tomcat6A
> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009route=Tomcat6B
> ProxySet stickysession=ROUTEID
> </Proxy>
>
ProxyPass / balancer://cluster/
> ProxyPassReverse / balancer://cluster/
>
>
For mod_proxy_balancer (if you insist), I would put something like this:
<Proxy balancer://cluster>
BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009route=Tomcat6A
BalancerMember
ajp://chimps-lb-02.cable.bogus.com:8009route=Tomcat6B status=+H
ProxySet stickysession=ROUTEID nofailover=Off lbmethod=bytraffic
</Proxy>
This puts Tomcat6B worker in hot backup state and the whole traffic is
redirected to Tomcat6A. Per my understanding, the above configuration means
that when the balancer worker on Tomcat6A is in error state, the balancer
will redirect the session to Tomcat6B which is marked as hot backup . The
tomcat session replication remark is valid in this scenario too.
The configuration above alternates between each tomcat as request come
> in, which is not what I want.
>
> I created a workers.properties file in /etc/httpd/conf/, based on the
> loadBalance Howto, but it does not seem to have any effect on the
> system. Does mod_proxy use it?
>
> worker.list=balance1
>
> # The load balancer worker balance1 will distribute
> # load to the members Tomcat6A, Tomcat6B
> worker.balance1.type=lb
> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
>
> worker.Tomcat6A.type = ajp13
> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
> worker.Tomcat6A.port = 8009
> worker.Tomcat6A.redirect=Tomcat6B
> #worker.Tomcat6A.lbfactor = 10
>
> worker.Tomcat6B.type = ajp13
> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
> worker.Tomcat6B.port = 8009
> worker.Tomcat6B.activation=disabled
>
> Each tomcat server.xml has
> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6A">
> or
> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6B">
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd] Apache + 2 tomcat appserver failover configuration
Posted by Igor Cicimov <ic...@gmail.com>.
On Aug 31, 2012 11:14 AM, "Ed Young" <ej...@summitbid.com> wrote:
>
> I've set up a load balancing configuration based on an Apache server
> and two tomcats Tomcat6A, and Tomcat6B. I'm trying to set it up so
> that Tomcat6B is a failover server, so if Tomcat6A goes down, Tomcat6B
> will handle all subsequent requests.
>
> I have two questions:
> 1. Does mod_proxy use the workers.properties file? It doesn't seem to
> make any difference what is in workers.properties.
No it doesnt it is used by mod_jk
> 2. How can I set this system up for a failover configuration?
>
First decide which module you want to use. Replacement means mod_jk is the
ild way of doing things and mod_proxy is a new way. These modules are not
related so you misunderstood thst part.
> This is killing me. I'm using mod_proxy, mod_proxy_balancer, mod_ajp.
>
> In the load balancer howto, it specifies the configuration I want by
> using the workers.properties file, but that file seems to have no
> effect on the system behavior. I wonder if it was written before
> mod_proxy became a replacement for mod_jk.
> _http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
>
> No matter what I do, if I shut down Tomcat6A, there is no failover
> behavior. Existing Tomcat6A request fail (expected) and new requests
> fail with 404. Only the existing Tomcat6B request continue.
>
> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
> env=BALANCER_ROUTE_CHANGED
> <Proxy balancer://cluster>
> BalancerMember ajp://chimps-lb-01.cable.bogus.com:8009route=Tomcat6A
> BalancerMember ajp://chimps-lb-02.cable.bogus.com:8009route=Tomcat6B
> ProxySet stickysession=ROUTEID
> </Proxy>
> ProxyPass / balancer://cluster/
> ProxyPassReverse / balancer://cluster/
>
> The configuration above alternates between each tomcat as request come
> in, which is not what I want.
>
> I created a workers.properties file in /etc/httpd/conf/, based on the
> loadBalance Howto, but it does not seem to have any effect on the
> system. Does mod_proxy use it?
>
> worker.list=balance1
>
> # The load balancer worker balance1 will distribute
> # load to the members Tomcat6A, Tomcat6B
> worker.balance1.type=lb
> worker.balance1.balance_workers=Tomcat6A, Tomcat6B
>
> worker.Tomcat6A.type = ajp13
> worker.Tomcat6A.host = chimps-lb-01.cable.bogus.com
> worker.Tomcat6A.port = 8009
> worker.Tomcat6A.redirect=Tomcat6B
> #worker.Tomcat6A.lbfactor = 10
>
> worker.Tomcat6B.type = ajp13
> worker.Tomcat6B.host = chimps-lb-02.cable.bogus.com
> worker.Tomcat6B.port = 8009
> worker.Tomcat6B.activation=disabled
>
> Each tomcat server.xml has
> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6A">
> or
> <Engine name="Standalone" defaultHost="localhost" jvmRoute="Tomcat6B">
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>