Re: Different apps clustering on the same Tomcat?

2010-01-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

John,

On 1/20/2010 10:28 PM, John Tangney wrote:
 We use a cluster to do seamless deploys. We use Nginx on the front end
 to direct traffic to one or other of the nodes in the cluster. To
 deploy, we bring up the new version of the app in a one node, tell Nginx
 to send traffic to that node, then bring down the other node. Because
 sessions are propagated, users never notice that one node has been
 exchanged for another.

Careful: if you change the definition of any of the classes whose
objects are in the session, you'll get a nasty replication error
(because de-serialization will fail). Be careful with anything you
modify that might be lurking in a user's session.

 We need to add two more nodes that run on Windows (we have
 platform-specific code, and Nginx sends windows traffic to one of the
 windows nodes based on URL) but we only have one Windows box. We thought
 that perhaps we could just run a second instance of the app on the
 Windows node.
 
 From what you said previously, this does not appear to be possible. So
 we'll be looking new hardware.

Oh, you can certainly do it. Knowing why you want to do it certainly
helps clear things up. I'm still as confused as Chuck is, though :)

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

iEYEARECAAYFAktYcQ0ACgkQ9CaO5/Lv0PDZCgCdF4KSG28DNwocB2nYQyuX6gHU
Me0AniApCDjAYyRRM+kAGI/nkBIv6+Oc
=rdu1
-END PGP SIGNATURE-

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



RE: Different apps clustering on the same Tomcat?

2010-01-20 Thread John Tangney
Thanks, Chuck.

Caldarale, Charles R chuck.caldar...@unisys.com wrote ..
  From: John Tangney [mailto:jo...@jdtangney.com]
  Is it possible to get two apps in the same Tomcat instance to exchange
  session info, in a cluster? If so, how?

 Not sure what you're asking.

Apologies if I was not clear.

We have two machines, each with a Tomcat, forming a cluster. An app named gh 
runs on each cluster node. We want to add a second app to one of the Tomcats 
(call it gh2 – it's just a clone of gh) that synchronizes sessions with gh on 
all of the nodes.

 Multiple apps in one Tomcat cannot share a session, since that's prohibited by
 the servlet spec.

I think you've answered my question. So gh2 cannot synchronize sessions with gh 
– on the same cluster node or not.

 You can create a bean from a class in a shared library to hold
 data needed by both apps.

Ah, this sounds promising! Where would this shared library live so that both 
apps can talk to it?

Just for background... In an ideal world, we'd just buy another server and add 
it to the (existing) cluster. But we are looking for ways to get the benefit of 
another cluster node without new hardware.

Thanks!
--johnt


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

Re: Different apps clustering on the same Tomcat?

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

John,

On 1/20/2010 12:37 PM, John Tangney wrote:
 Just for background... In an ideal world, we'd just buy another 
 server and add it to the (existing) cluster. But we are looking for
 ways to get the benefit of another cluster node without new
 hardware.

Is this need for a new server related to your desire to add a shadow
copy of the webapp? If so, I don't see the point: deploying another
instance of the webapp into an existing Tomcat isn't going to help you
serve any more users... which would be the point of bringing another
server online. Maybe I don't understand.

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

iEYEARECAAYFAktXUHIACgkQ9CaO5/Lv0PDl+ACfQri+1/l/fY4JAB2WkMqTl/E/
xWQAnAz4//+Mwqb+ovDnH3sWCsQRjwxi
=GrHE
-END PGP SIGNATURE-

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



RE: Different apps clustering on the same Tomcat?

2010-01-20 Thread Caldarale, Charles R
 From: John Tangney [mailto:jo...@jdtangney.com]
 Subject: RE: Different apps clustering on the same Tomcat?
 
 We have two machines, each with a Tomcat, forming a cluster. An app
 named gh runs on each cluster node. We want to add a second app to
 one of the Tomcats (call it gh2 ? it's just a clone of gh) that
 synchronizes sessions with gh on all of the nodes.

Like Chris, I still don't really understand what you're trying to achieve.

  You can create a bean from a class in a shared library to hold
  data needed by both apps.
 
 Ah, this sounds promising! Where would this shared library live so that
 both apps can talk to it?

In Tomcat 6, $CATALINA_HOME/lib; in 5.5, $CATALINA_HOME/shared/lib (or 
classes).  You also have the option of modifying conf/catalina.properties and 
defining your own location for classloaders to examine.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: Different apps clustering on the same Tomcat?

2010-01-20 Thread John Tangney

On Jan 20, 2010, at 10:57 AM, Caldarale, Charles R wrote:


From: John Tangney [mailto:jo...@jdtangney.com]
Subject: RE: Different apps clustering on the same Tomcat?

We have two machines, each with a Tomcat, forming a cluster. An app
named gh runs on each cluster node. We want to add a second app to
one of the Tomcats (call it gh2 ? it's just a clone of gh) that
synchronizes sessions with gh on all of the nodes.


Like Chris, I still don't really understand what you're trying to  
achieve.


We use a cluster to do seamless deploys. We use Nginx on the front end  
to direct traffic to one or other of the nodes in the cluster. To  
deploy, we bring up the new version of the app in a one node, tell  
Nginx to send traffic to that node, then bring down the other node.  
Because sessions are propagated, users never notice that one node has  
been exchanged for another.


We need to add two more nodes that run on Windows (we have platform- 
specific code, and Nginx sends windows traffic to one of the windows  
nodes based on URL) but we only have one Windows box. We thought that  
perhaps we could just run a second instance of the app on the Windows  
node.


From what you said previously, this does not appear to be possible.  
So we'll be looking new hardware.


Thanks for all your help!
--johnt


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



RE: Different apps clustering on the same Tomcat?

2010-01-20 Thread Caldarale, Charles R
 From: John Tangney [mailto:jo...@jdtangney.com]
 Subject: Re: Different apps clustering on the same Tomcat?
 
 We use a cluster to do seamless deploys. We use Nginx on the front end
 to direct traffic to one or other of the nodes in the cluster. To
 deploy, we bring up the new version of the app in a one node, tell
 Nginx to send traffic to that node, then bring down the other node.
 Because sessions are propagated, users never notice that one node has
 been exchanged for another.

This is fairly typical.

 We need to add two more nodes that run on Windows (we have platform-
 specific code, and Nginx sends windows traffic to one of the windows
 nodes based on URL) but we only have one Windows box. We thought that
 perhaps we could just run a second instance of the app on the Windows
 node.

This is the part that I can't make sense of.  You talk about two more Windows 
nodes, which I take to mean two more OS/JVM/Tomcat instances.  Then you talk 
about *one* additional instance of your existing webapp running in the same 
Tomcat, but using a different name.  Your numbers don't match up.

You can run multiple instances of Tomcat on the same box, and each could have a 
copy of the app deployed, and each Tomcat could be a separate node in the 
cluster.  You would need to give each Tomcat instance a unique IP address or 
set of ports, of course, and make sure you have enough RAM to handle all 
instances without provoking paging.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: Different apps clustering on the same Tomcat?

2010-01-20 Thread John Tangney

On Jan 20, 2010, at 7:38 PM, Caldarale, Charles R wrote:

You can run multiple instances of Tomcat on the same box, and each  
could have a copy of the app deployed, and each Tomcat could be a  
separate node in the cluster.


That's exactly what we do on Linux, but it fails on Windows due to a  
bug I have already logged.


--johnt


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



RE: Different apps clustering on the same Tomcat?

2010-01-20 Thread Caldarale, Charles R
 From: John Tangney [mailto:jo...@jdtangney.com]
 Subject: Re: Different apps clustering on the same Tomcat?
 
 That's exactly what we do on Linux, but it fails on Windows due to a
 bug I have already logged.

What bug is that?  I run multiple Tomcats concurrently on Vista 64 without a 
problem.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



RE: Different apps clustering on the same Tomcat?

2010-01-19 Thread Caldarale, Charles R
 From: John Tangney [mailto:jo...@jdtangney.com]
 Subject: Different apps clustering on the same Tomcat?
 
 Is it possible to get two apps in the same Tomcat instance to exchange
 session info, in a cluster? If so, how?

Not sure what you're asking.  If there's only one Tomcat instance, there's no 
cluster.  Multiple apps in one Tomcat cannot share a session, since that's 
prohibited by the servlet spec.  You can create a bean from a class in a shared 
library to hold data needed by both apps.

If you really do have a cluster of multiple Tomcat instances, you can choose to 
replicate session information across them by any of several means.  Consult the 
documentation for details:
http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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