You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paolo Santarsiero <pa...@gmail.com> on 2009/11/20 10:22:09 UTC

cluster deployment by context descriptors

Hi all, I have a cluster with Apache2.2 and three Tomcat 6 instances in load
balance and sticky sessions on three different servers. I use another server
like webapps repository, so my tomcat's go to applications by context
descriptors. But I don't want all three tom go on all apllications, so I
replicate same context to only tomcats I want. This doesn't works fine,
beacause sometimes the tom that doesn't point to that application receive
the request and display a 404 page. How can I solve the problem? Thanks

Re: cluster deployment by context descriptors

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paolo,

On 11/20/2009 5:36 AM, Paolo Santarsiero wrote:
> So I must configure vhost under apache for a specific webapp and then create
> context descriptor for specific tomcats under default host (ex. under tom1
> and tom2 and not under tom3). Or must I create vhost under specific tomcats
> too?

No, you just have to use different load-balancing configurations for
each set of webapps you want to deploy differently.

Let's say you have 2 webapps: A and B.
Let's say you have 6 app servers: 1, 2, 3, 4, 5, and 6.
Let's say you have the following deployments:

Server	Webapps
1	A
2	B
3	A
4	B
5	A, B
6       A, B

You will want to set up your workers to load balance webapp A separately
from webapp B, maybe like this:

workers.properties
- ------------------
worker.list=lbA, lbB

worker.lbA.type=lb
worker.lbA.balance_workers=server1, server3, server5, server6

worker.lbB.type=lb
worker.lbB.balance_workers=server2, server4, server5, server6

// now, configure the serverX workers in some obvious way

httpd.conf
- ----------

JkMount /webappA|/* lbA

JkMount /webappB|/* lbB

This should "protect" you from sending your requests to the wrong server.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksYKZwACgkQ9CaO5/Lv0PAptACgmd+CBgY6Ku0/X21q7TtepHTY
X24AoIEiPy6MvmJWNIUq1I/yjZ91qBSp
=73aU
-----END PGP SIGNATURE-----

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


Re: cluster deployment by context descriptors

Posted by Paolo Santarsiero <pa...@gmail.com>.
So I must configure vhost under apache for a specific webapp and then create
context descriptor for specific tomcats under default host (ex. under tom1
and tom2 and not under tom3). Or must I create vhost under specific tomcats
too?

2009/11/20 Pid <pi...@pidster.com>

> On 20/11/2009 09:22, Paolo Santarsiero wrote:
>
>> Hi all, I have a cluster with Apache2.2 and three Tomcat 6 instances in
>> load
>> balance and sticky sessions on three different servers. I use another
>> server
>> like webapps repository, so my tomcat's go to applications by context
>> descriptors. But I don't want all three tom go on all apllications, so I
>> replicate same context to only tomcats I want. This doesn't works fine,
>> beacause sometimes the tom that doesn't point to that application receive
>> the request and display a 404 page. How can I solve the problem? Thanks
>>
>>
> Problem: you're sending the traffic to the wrong Tomcats?
> Solution: don't send the traffic to the wrong Tomcat.
>
> Your mod_jk or mod_proxy load balancing config is sending* the traffic to
> Tomcat instances without the right apps, so you'll have to modify your
> config to ensure it does not do that.
>
> There's no magic fix for undoing something you've told it to do.
>
>
> p
>
>
> * I'm guessing here, because your post is a bit short of actual details.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: cluster deployment by context descriptors

Posted by Pid <pi...@pidster.com>.
On 20/11/2009 09:22, Paolo Santarsiero wrote:
> Hi all, I have a cluster with Apache2.2 and three Tomcat 6 instances in load
> balance and sticky sessions on three different servers. I use another server
> like webapps repository, so my tomcat's go to applications by context
> descriptors. But I don't want all three tom go on all apllications, so I
> replicate same context to only tomcats I want. This doesn't works fine,
> beacause sometimes the tom that doesn't point to that application receive
> the request and display a 404 page. How can I solve the problem? Thanks
>

Problem: you're sending the traffic to the wrong Tomcats?
Solution: don't send the traffic to the wrong Tomcat.

Your mod_jk or mod_proxy load balancing config is sending* the traffic 
to Tomcat instances without the right apps, so you'll have to modify 
your config to ensure it does not do that.

There's no magic fix for undoing something you've told it to do.


p


* I'm guessing here, because your post is a bit short of actual details.

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