On 23/12/2009 00:36, John Tangney wrote:
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, are both Tomcats using the same IP address?
p
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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org