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 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 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



Different apps clustering on the same Tomcat?

2010-01-19 Thread John Tangney
Is it possible to get two apps in the same Tomcat instance to exchange session 
info, in a cluster? If so, how?

Thanks!
--johnt


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



Re: Running two tomcat servers on same system?

2010-01-07 Thread John Tangney

Dean,

On Jan 7, 2010, at 1:47 PM, Dean Chester wrote:

I am wondering if it would be possible to have two tomcat servers  
running on

the same system


Yeah, we do this all the time. All you gave to do is to make sure that  
all the ports listed in your server.xml are unique.



Also is it possible to share
shutdown ports of tomcat servers?


I am not sure. It's easy enough to give it a try.

--johnt

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



Re: Error running two tomcats in same cluster on same Windows box

2009-12-26 Thread John Tangney

Konstantin,

Thanks for your in-depth analysis! I am still on vacation so I have  
had not had a chance to follow all your references.


Here is some log output:
INFO: Initializing Coyote HTTP/1.1 on http-8180
Dec 22, 2009 2:17:07 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 332 ms
Dec 22, 2009 2:17:07 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 22, 2009 2:17:07 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
Dec 22, 2009 2:17:07 PM org.apache.catalina.ha.tcp.SimpleTcpCluster  
start

INFO: Cluster is about to start
Dec 22, 2009 2:17:07 PM  
org.apache.catalina.tribes.transport.ReceiverBase bind

INFO: Receiver Server Socket bound to:/10.5.1.102:4000
Dec 22, 2009 2:17:07 PM  
org.apache.catalina.tribes.membership.McastServiceImpl setupSocket

INFO: Attempting to bind the multicast socket to /224.0.0.0:45564
Dec 22, 2009 2:17:07 PM  
org.apache.catalina.tribes.membership.McastServiceImpl setupSocket

INFO: Setting multihome multicast interface to:/10.5.1.102
Dec 22, 2009 2:17:07 PM org.apache.catalina.ha.tcp.SimpleTcpCluster  
start

SEVERE: Unable to start cluster.
org.apache.catalina.tribes.ChannelException: java.net.SocketException:  
An operation was attempted on something that is not a socket; No  
faulty members identified.

...
Caused by: java.net.SocketException: An operation was attempted on  
something that is not a socket


On Dec 26, 2009, at 1:34 AM, Konstantin Kolinko wrote:


2) John Tangney,
do you see the following one or two INFO messages in Tomcat log:
log.info(Attempting to bind the multicast socket to +address 
+:+port);
log.info(Binding to multicast address, failed. Binding to port  
only.);


INFO: Attempting to bind the multicast socket to /224.0.0.0:45564


3)
It is possible to create unbound MulticastSocket, by passing a null
instead of  SocketAddress to its constructor.

Maybe the  socket.setInterface(mcastBindAddress);  call will succeed
if we create an unbound socket with new MulticastSocket(null), make
setInterface() call, and call bind() later.


When I get back to work I will be able to follow up on your research  
and perhaps try #3 – unless someone else tries it first. If that  
works, we'll either need to run a custom Tomcat or wait for the patch  
(assuming it's accepted) is released.


Thanks again for your help!
---johnt


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



Re: Error running two tomcats in same cluster on same Windows box

2009-12-25 Thread John Tangney

We are still experiencing this problem.

To summarize:
1) We are using 6.0.18.
2) A single Tomcat works fine and joins the cluster.
3) Two Tomcats on the SAME MACHINE (different ports - duh) but  
multicasting to DIFFERENT multicast IPs each join their respective  
clusters. (yes, two clusters.)
4) Two Tomcats on the SAME machine multicasting to the SAME multicast  
IP and we get An operation was attempted on something that is not a  
socket when we launch the second tomcat.

5) The exact setup works fine on RHEL and Mac OS X

This is NOT the 6.0.20 regression (https://issues.apache.org/bugzilla/show_bug.cgi?id=47308 
) – we're using 6.0.18.
This is NOT an issue with Windows getting confused by the bind  
attribute – it works fine in cases 2  3 above.


Could it be that windows won't allow two apps to multicast to the same  
address at the same time?


Can anyone help with this issue?

--johnt


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



Re: Error running two tomcats in same cluster on same Windows box

2009-12-23 Thread John Tangney

Thanks for your response, Filip!

On Dec 23, 2009, at 6:05 AM, Filip Hanik - Dev Lists wrote:


sorry, ignore previous post,


Yeah, I had the same reaction to 224.0.0.0 but it works when one  
Tomcat is running, so I assumed it's OK.



it's failing on this operation:

socket.setInterface(mcastBindAddress);

There is a small chance that Window's doesn't allow multicast  
sockets to be bound to an IP

try removing the bind attribute


No, that can't be it, because when I run just one tomcat on that  
windows machine (with the bind – without it Tomcat will bind to the  
wrong NIC which is itself a problem) everything works just fine. It's  
only when I run two tomcats at the same time with the same  
Membership ...


Could it be that Windows (or some layer in between) is holding a  
socket open? Is that what An operation was attempted on something  
that is not a socket means?


Thanks!
--johnt


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



Re: Error running two tomcats in same cluster on same Windows box

2009-12-23 Thread John Tangney

On Dec 23, 2009, at 12:19 PM, Filip Hanik - Dev Lists wrote:


On 12/23/2009 11:42 AM, John Tangney wrote:

it's failing on this operation:

socket.setInterface(mcastBindAddress);

There is a small chance that Window's doesn't allow multicast  
sockets to be bound to an IP

try removing the bind attribute


No, that can't be it

did you try it?


Yes, I did try that.

With the bind attribute, a SINGLE tomcat binds to the correct NIC and  
the cluster works perfectly. It's only when we have TWO tomcats both  
on the same machine that we have the problem.


Without the bind attribute, Tomcat binds to the wrong NIC which  
prevents the other nodes from getting the multicast packets.


I could experiment with another windows box to see if I can run 2  
tomcats without the bind attribute. (I can't do that on the machine  
that's experiencing the prob because it's a production box.) But even  
if that works, we stuck, because we have to use the 2nd NIC for  
clustering.


Could it be that a socket is not being closed?

Thanks!
--johnt



Re: Error running two tomcats in same cluster on same Windows box

2009-12-23 Thread John Tangney

On Dec 23, 2009, at 2:36 PM, Filip Hanik - Dev Lists wrote:


On 12/23/2009 01:46 PM, John Tangney wrote:

On Dec 23, 2009, at 12:19 PM, Filip Hanik - Dev Lists wrote:


On 12/23/2009 11:42 AM, John Tangney wrote:

it's failing on this operation:

socket.setInterface(mcastBindAddress);

There is a small chance that Window's doesn't allow multicast  
sockets to be bound to an IP

try removing the bind attribute


No, that can't be it

did you try it?


Yes, I did try that.

With the bind attribute, a SINGLE tomcat binds to the correct NIC  
and the cluster works perfectly. It's only when we have TWO tomcats  
both on the same machine that we have the problem.

That, my friend, is a totally different problem.


I tried to be complete in the subject line and in the body of my post.  
My apologies if I was not 100% clear.



A regression in in 6.0.20 only
https://issues.apache.org/bugzilla/show_bug.cgi?id=47308


We're using 6.0.18. (Yes, I know I should have mentioned that in my  
original posting.)


--johnt


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



Error running two tomcats in same cluster on same Windows box

2009-12-22 Thread John Tangney

We run two tomcats on the same Windows Server 2008 box. They have their
server.xml tweaked so that they use unique ports. Here's a diff:

$ diff server.xml /cygdrive/c/Program\ Files/Apache\ Software\
Foundation/Tomcat\ 6.0/conf/server.xml 
22c22
 Server port=8105 shutdown=SHUTDOWN
---
 Server port=8005 shutdown=SHUTDOWN
67c67
 Connector port=8180 protocol=HTTP/1.1 
---
 Connector port=8080 protocol=HTTP/1.1 
69c69
redirectPort=8543 /
---
redirectPort=8443 /
88c88
 Connector port=8109 protocol=AJP/1.3 redirectPort=8543 /
---
 Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /
100c100
 Engine name=WinBox_Temp defaultHost=localhost
jvmRoute=WinBox_temp
---
 Engine name=WinBox defaultHost=localhost jvmRoute=WinBox

If we have one of the tomcats broadcast its multicast packets on 228.0.0.0
while the second broadcasts on 224.0.0.0, everything works fine and they
each cluster with other nodes that use those multicast addresses. (Think
staging and prod clusters)

But when we want two tomcats on the same machine to join the _same_ cluster
(224.0.0.0), we get this in the log file:

SEVERE: Unable to start cluster.
org.apache.catalina.tribes.ChannelException: java.net.SocketException: An
operation was attempted on something that is not a socket; No faulty
 members identified.
at
org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:169)
at
org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:97)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:147)
   
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at
org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:407)
at
org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:669)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1035)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)   
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)   

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)  
 
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.SocketException: An operation was attempted on something
that is not a socket
at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method)
at
java.net.PlainDatagramSocketImpl.setOption(PlainDatagramSocketImpl.java:299)
at java.net.MulticastSocket.setInterface(MulticastSocket.java:420)
at
org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket(McastServiceImpl.java:206)
at
org.apache.catalina.tribes.membership.McastServiceImpl.init(McastServiceImpl.java:173)
at
org.apache.catalina.tribes.membership.McastServiceImpl.init(McastServiceImpl.java:169)
at
org.apache.catalina.tribes.membership.McastService.start(McastService.java:356) 
  
at
org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:154)
   
... 18 more

Here's the juicy part of server.xml:
   Membership
className=org.apache.catalina.tribes.membership.McastService
   address=224.0.0.0
   bind=10.5.1.102
   port=45564
   frequency=500
   dropTime=3000/

Naturally, I have googled the exception, but the only hits I have found go
on about corrupted winsock registry entries, which seems irrelevant since
everything works when the two tomcats use separate multicast addresses.

Note that 10.5.1.102 is a statically-assigned IP on this box's second NIC. 

So...
a) Is it possible to run two tomcat nodes in the same cluster on the same
windows box?
b) If so, what's the magic to keep windows happy? It _appears_ that windows
won't let the two tomcats bind to the same multicast address/port. (Same
config works fine on Linux.)

Thanks!
--johnt
-- 
View this message in context: 
http://old.nabble.com/Error-running-two-tomcats-in-same-cluster-on-same-Windows-box-tp26896489p26896489.html
Sent from the