You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2008/10/02 20:27:30 UTC

Re: Tomcat JVM not releasing deleted files (lsof show delete inodes taking up disk space)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chad,

Chad Kellerman wrote:
> To get a better understanding... the application indexes
> uploaded files, the indexing process creates the temporary files then
> removes them.

Can you share the code that actually does this? The javadoc for
File.createTempFile states:

"To arrange for a file created by this method to be deleted
automatically, use the deleteOnExit() method."

If your engineers followed this advice, this may be your problem: the
JVM is waiting until JVM shutdown to actually delete the files. Even if
the code does an explicit File.delete(), the JVM is probably still
hanging onto a reference to the file's directory entry in order to
delete it on exit. That seems like a plausible explanation for why the
files are marked as "deleted" in lsof, but are still being kept alive by
the JVM.

The solution here would be to simply not use File.deleteOnExit; instead,
use File.delete explicitly.

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

iEYEARECAAYFAkjlEpIACgkQ9CaO5/Lv0PBo0wCfRhUitB/6/pxDQiGtbdo0Ctwk
qj4AnjuQwMY3yduWoAN5/InlbZnX1CW6
=i6Uc
-----END PGP SIGNATURE-----

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


Re: Basic Tribes Questions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
oh, of course, and that is easy

1. svn co http://svn.apache.org/repos/asf/tomcat/trunk
2. cd trunk
3. ant download
4. ant

catalina-tribes.jar would be in outbuild/build/lib/catalina-tribes.jar


Filip

Mike Wannamaker wrote:
> Yes, I know it's in the tomcat distribution, but lets say you fix the TCPFailureDetector I would have to wait until a new version of tomcat is published before getting the fix?  There is no repository I could get it from and build myself?
>
> Mike
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> Sent: October 8, 2008 3:09 PM
> To: Tomcat Users List
> Subject: Re: Basic Tribes Questions
>
> catalina-tribes.jar
>
> it depends on
>
> tomcat-juli.jar
>
> both of them are in the binary distribution for Tomcat
>
> Filip
>
> Mike Wannamaker wrote:
>   
>> Cool,
>>
>> Is there a repository to just get the tribes jar or just the tribes source without having to get all of tomcat to get it?
>>
>> Like a SVN or CVS repository I could get the fix from and build myself?
>>
>> Thanks
>> Mike
>>
>> -----Original Message-----
>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>> Sent: October 7, 2008 5:13 PM
>> To: Tomcat Users List
>> Subject: Re: Basic Tribes Questions
>>
>> hi Mike, that's great. yes, the TCP failure detector could give multiple 
>> "DISAPPEARED" messages, that is something I'm about to fix
>>
>> Filip
>>
>> Mike Wannamaker wrote:
>>   
>>     
>>> Hi Filip,
>>>
>>> I think I am seeing the message, it was just hidden amongst other log messages I guess I missed it.
>>>
>>> However I do see something else when I added the TcpFailureDetector to the interceptor list, I see two DISAPPEARED messages?
>>>
>>> Without TcpFailureDetector:
>>>
>>> 	1) Start Server #1, then #2
>>> 	2) Unplug #2 network
>>> 	3) On #1 - #2 DISAPPEARED, on #2 - #1 DISAPPEARED
>>> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>>>
>>> Add TcpFailureDetector
>>>
>>> 	1) Start Server #1, #2
>>> 	2) Unplug #2 network
>>> 	3) On #1 - #2 DISAPPEARED;#2 DISAPPEARED, on #2 - #1 DISAPPEARED;#1 DISAPPEARED
>>> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>>>
>>> I take it I get the 2 DISAPPEARED messages because I have another interceptor, but is this the correct behaviour?
>>>
>>> TIA
>>> Mike
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>>> Sent: October 6, 2008 11:28 AM
>>> To: Tomcat Users List
>>> Subject: Re: Basic Tribes Questions
>>>
>>> there are getters and setters for everything
>>> and they are all documented here
>>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>>
>>> each component has getters/setters, for example, the multicast address
>>>
>>> setAddress
>>> getAddress
>>>
>>> breakpoints might not work very well, since you are stopping one thread, 
>>> and not really emulating a real scenario.
>>>
>>> again, sounds like you have a simple test case, if you can share that, I 
>>> can get more understanding, and help you further.
>>>
>>> Filip
>>>
>>> Mike Wannamaker wrote:
>>>   
>>>     
>>>       
>>>> Hi Filip
>>>>
>>>> Thanks for the info.  However, I don't see the documentation for the setters/getters you mention below?
>>>> Also I'm having issues while debugging.  When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server?  I would think the heartbeat is running in a separate thread for both send/receive?  How to solve this, bump the heartbeat timeout?
>>>>
>>>> TIA
>>>> Mike
>>>>
>>>> -----Original Message-----
>>>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>>>> Sent: October 3, 2008 2:51 PM
>>>> To: Tomcat Users List
>>>> Subject: Re: Basic Tribes Questions
>>>>
>>>> answers inline
>>>>
>>>> Mike Wannamaker wrote:
>>>>   
>>>>     
>>>>       
>>>>         
>>>>> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>>>>>
>>>>> My startup code looks like this.
>>>>>
>>>>>         if(_tribesChannel == null)
>>>>>         { // nothing to do if already running
>>>>>             try
>>>>>             {
>>>>>                 _tribesChannel = new GroupChannel();
>>>>>                 // must be done before start:
>>>>>   
>>>>>     
>>>>>       
>>>>>         
>>>>>           
>>>> no need to use any properties, there are getters and setters for everything
>>>> and they are all documented here
>>>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>>>   
>>>>     
>>>>       
>>>>         
>>>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>>>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>>>>>   
>>>>>     
>>>>>       
>>>>>         
>>>>>           
>>>> not sure what you are trying to do in the code below. if you wanna set 
>>>> the port, then simply do it.
>>>> the membership will pick it up automatically
>>>>   
>>>>     
>>>>       
>>>>         
>>>>>                 if(_ancillaryPort > 0)
>>>>>                 {
>>>>>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>>>>>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>>>>>                     // Therefore, set it directly
>>>>>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>>>>>                     if(receiver.getPort() != _ancillaryPort)
>>>>>                     {
>>>>>                         if(receiver instanceof ReceiverBase)
>>>>>                         {
>>>>>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>>>>>                         }
>>>>>                     }
>>>>>                 }
>>>>>
>>>>>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>>>>>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>>>>>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>>>>>             }
>>>>>             catch(ChannelException ex)
>>>>>             {
>>>>>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>>>>>                 _tribesChannel = null;
>>>>>                 throw new RuntimeException(ex); // todo, exception handling?
>>>>>             }
>>>>>         }
>>>>>
>>>>> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>>>>>   
>>>>>     
>>>>>       
>>>>>         
>>>>>           
>>>> the message you are getting is cause the membership tries to recover.
>>>> you can limit this, by doing
>>>> setRecoveryEnabled(true|false);
>>>> setRecoveryCounter(nr-of-times-to-try-recover)
>>>>
>>>> also, you haven't added in the TCP failure detector, which adds one more 
>>>> layer of protection
>>>> see it in this default configuration
>>>> http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
>>>>
>>>> you should still get the member disappeared error (eventually after the 
>>>> timeout), if you can supply a simple test case, I can try it out over here.
>>>>
>>>> best
>>>> Filip
>>>>
>>>>   
>>>>     
>>>>       
>>>>         
>>>>> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>>>>>
>>>>> 	INFO: Done sleeping, membership established, start level:8
>>>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
>>>>> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
>>>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
>>>>> 	WARNING: Unable to send mcast message.
>>>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
>>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>>>> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
>>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
>>>>> 	WARNING: Recovery thread failed to stop membership service.
>>>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>>>>> 	INFO: Setting cluster mcast soTimeout to 500
>>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
>>>>> 	WARNING: Recovery thread failed to start membership service.
>>>>> 	java.net.SocketException: error setting options
>>>>> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
>>>>> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
>>>>> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
>>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>>>> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
>>>>> 	
>>>>>   
>>>>>     
>>>>>       
>>>>>         
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>   
>>>>     
>>>>       
>>>>         
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>   
>>>     
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


RE: Basic Tribes Questions

Posted by Mike Wannamaker <mw...@opentext.com>.
Yes, I know it's in the tomcat distribution, but lets say you fix the TCPFailureDetector I would have to wait until a new version of tomcat is published before getting the fix?  There is no repository I could get it from and build myself?

Mike

-----Original Message-----
From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
Sent: October 8, 2008 3:09 PM
To: Tomcat Users List
Subject: Re: Basic Tribes Questions

catalina-tribes.jar

it depends on

tomcat-juli.jar

both of them are in the binary distribution for Tomcat

Filip

Mike Wannamaker wrote:
> Cool,
>
> Is there a repository to just get the tribes jar or just the tribes source without having to get all of tomcat to get it?
>
> Like a SVN or CVS repository I could get the fix from and build myself?
>
> Thanks
> Mike
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> Sent: October 7, 2008 5:13 PM
> To: Tomcat Users List
> Subject: Re: Basic Tribes Questions
>
> hi Mike, that's great. yes, the TCP failure detector could give multiple 
> "DISAPPEARED" messages, that is something I'm about to fix
>
> Filip
>
> Mike Wannamaker wrote:
>   
>> Hi Filip,
>>
>> I think I am seeing the message, it was just hidden amongst other log messages I guess I missed it.
>>
>> However I do see something else when I added the TcpFailureDetector to the interceptor list, I see two DISAPPEARED messages?
>>
>> Without TcpFailureDetector:
>>
>> 	1) Start Server #1, then #2
>> 	2) Unplug #2 network
>> 	3) On #1 - #2 DISAPPEARED, on #2 - #1 DISAPPEARED
>> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>>
>> Add TcpFailureDetector
>>
>> 	1) Start Server #1, #2
>> 	2) Unplug #2 network
>> 	3) On #1 - #2 DISAPPEARED;#2 DISAPPEARED, on #2 - #1 DISAPPEARED;#1 DISAPPEARED
>> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>>
>> I take it I get the 2 DISAPPEARED messages because I have another interceptor, but is this the correct behaviour?
>>
>> TIA
>> Mike
>>
>>
>>
>> -----Original Message-----
>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>> Sent: October 6, 2008 11:28 AM
>> To: Tomcat Users List
>> Subject: Re: Basic Tribes Questions
>>
>> there are getters and setters for everything
>> and they are all documented here
>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>
>> each component has getters/setters, for example, the multicast address
>>
>> setAddress
>> getAddress
>>
>> breakpoints might not work very well, since you are stopping one thread, 
>> and not really emulating a real scenario.
>>
>> again, sounds like you have a simple test case, if you can share that, I 
>> can get more understanding, and help you further.
>>
>> Filip
>>
>> Mike Wannamaker wrote:
>>   
>>     
>>> Hi Filip
>>>
>>> Thanks for the info.  However, I don't see the documentation for the setters/getters you mention below?
>>> Also I'm having issues while debugging.  When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server?  I would think the heartbeat is running in a separate thread for both send/receive?  How to solve this, bump the heartbeat timeout?
>>>
>>> TIA
>>> Mike
>>>
>>> -----Original Message-----
>>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>>> Sent: October 3, 2008 2:51 PM
>>> To: Tomcat Users List
>>> Subject: Re: Basic Tribes Questions
>>>
>>> answers inline
>>>
>>> Mike Wannamaker wrote:
>>>   
>>>     
>>>       
>>>> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>>>>
>>>> My startup code looks like this.
>>>>
>>>>         if(_tribesChannel == null)
>>>>         { // nothing to do if already running
>>>>             try
>>>>             {
>>>>                 _tribesChannel = new GroupChannel();
>>>>                 // must be done before start:
>>>>   
>>>>     
>>>>       
>>>>         
>>> no need to use any properties, there are getters and setters for everything
>>> and they are all documented here
>>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>>   
>>>     
>>>       
>>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>>>>   
>>>>     
>>>>       
>>>>         
>>> not sure what you are trying to do in the code below. if you wanna set 
>>> the port, then simply do it.
>>> the membership will pick it up automatically
>>>   
>>>     
>>>       
>>>>                 if(_ancillaryPort > 0)
>>>>                 {
>>>>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>>>>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>>>>                     // Therefore, set it directly
>>>>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>>>>                     if(receiver.getPort() != _ancillaryPort)
>>>>                     {
>>>>                         if(receiver instanceof ReceiverBase)
>>>>                         {
>>>>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>>>>                         }
>>>>                     }
>>>>                 }
>>>>
>>>>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>>>>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>>>>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>>>>             }
>>>>             catch(ChannelException ex)
>>>>             {
>>>>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>>>>                 _tribesChannel = null;
>>>>                 throw new RuntimeException(ex); // todo, exception handling?
>>>>             }
>>>>         }
>>>>
>>>> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>>>>   
>>>>     
>>>>       
>>>>         
>>> the message you are getting is cause the membership tries to recover.
>>> you can limit this, by doing
>>> setRecoveryEnabled(true|false);
>>> setRecoveryCounter(nr-of-times-to-try-recover)
>>>
>>> also, you haven't added in the TCP failure detector, which adds one more 
>>> layer of protection
>>> see it in this default configuration
>>> http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
>>>
>>> you should still get the member disappeared error (eventually after the 
>>> timeout), if you can supply a simple test case, I can try it out over here.
>>>
>>> best
>>> Filip
>>>
>>>   
>>>     
>>>       
>>>> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>>>>
>>>> 	INFO: Done sleeping, membership established, start level:8
>>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
>>>> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
>>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
>>>> 	WARNING: Unable to send mcast message.
>>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>>> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
>>>> 	WARNING: Recovery thread failed to stop membership service.
>>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>>>> 	INFO: Setting cluster mcast soTimeout to 500
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
>>>> 	WARNING: Recovery thread failed to start membership service.
>>>> 	java.net.SocketException: error setting options
>>>> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
>>>> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
>>>> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>>> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
>>>> 	
>>>>   
>>>>     
>>>>       
>>>>         
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>   
>>>     
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


Re: Basic Tribes Questions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
catalina-tribes.jar

it depends on

tomcat-juli.jar

both of them are in the binary distribution for Tomcat

Filip

Mike Wannamaker wrote:
> Cool,
>
> Is there a repository to just get the tribes jar or just the tribes source without having to get all of tomcat to get it?
>
> Like a SVN or CVS repository I could get the fix from and build myself?
>
> Thanks
> Mike
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> Sent: October 7, 2008 5:13 PM
> To: Tomcat Users List
> Subject: Re: Basic Tribes Questions
>
> hi Mike, that's great. yes, the TCP failure detector could give multiple 
> "DISAPPEARED" messages, that is something I'm about to fix
>
> Filip
>
> Mike Wannamaker wrote:
>   
>> Hi Filip,
>>
>> I think I am seeing the message, it was just hidden amongst other log messages I guess I missed it.
>>
>> However I do see something else when I added the TcpFailureDetector to the interceptor list, I see two DISAPPEARED messages?
>>
>> Without TcpFailureDetector:
>>
>> 	1) Start Server #1, then #2
>> 	2) Unplug #2 network
>> 	3) On #1 - #2 DISAPPEARED, on #2 - #1 DISAPPEARED
>> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>>
>> Add TcpFailureDetector
>>
>> 	1) Start Server #1, #2
>> 	2) Unplug #2 network
>> 	3) On #1 - #2 DISAPPEARED;#2 DISAPPEARED, on #2 - #1 DISAPPEARED;#1 DISAPPEARED
>> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>>
>> I take it I get the 2 DISAPPEARED messages because I have another interceptor, but is this the correct behaviour?
>>
>> TIA
>> Mike
>>
>>
>>
>> -----Original Message-----
>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>> Sent: October 6, 2008 11:28 AM
>> To: Tomcat Users List
>> Subject: Re: Basic Tribes Questions
>>
>> there are getters and setters for everything
>> and they are all documented here
>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>
>> each component has getters/setters, for example, the multicast address
>>
>> setAddress
>> getAddress
>>
>> breakpoints might not work very well, since you are stopping one thread, 
>> and not really emulating a real scenario.
>>
>> again, sounds like you have a simple test case, if you can share that, I 
>> can get more understanding, and help you further.
>>
>> Filip
>>
>> Mike Wannamaker wrote:
>>   
>>     
>>> Hi Filip
>>>
>>> Thanks for the info.  However, I don't see the documentation for the setters/getters you mention below?
>>> Also I'm having issues while debugging.  When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server?  I would think the heartbeat is running in a separate thread for both send/receive?  How to solve this, bump the heartbeat timeout?
>>>
>>> TIA
>>> Mike
>>>
>>> -----Original Message-----
>>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>>> Sent: October 3, 2008 2:51 PM
>>> To: Tomcat Users List
>>> Subject: Re: Basic Tribes Questions
>>>
>>> answers inline
>>>
>>> Mike Wannamaker wrote:
>>>   
>>>     
>>>       
>>>> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>>>>
>>>> My startup code looks like this.
>>>>
>>>>         if(_tribesChannel == null)
>>>>         { // nothing to do if already running
>>>>             try
>>>>             {
>>>>                 _tribesChannel = new GroupChannel();
>>>>                 // must be done before start:
>>>>   
>>>>     
>>>>       
>>>>         
>>> no need to use any properties, there are getters and setters for everything
>>> and they are all documented here
>>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>>   
>>>     
>>>       
>>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>>>>   
>>>>     
>>>>       
>>>>         
>>> not sure what you are trying to do in the code below. if you wanna set 
>>> the port, then simply do it.
>>> the membership will pick it up automatically
>>>   
>>>     
>>>       
>>>>                 if(_ancillaryPort > 0)
>>>>                 {
>>>>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>>>>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>>>>                     // Therefore, set it directly
>>>>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>>>>                     if(receiver.getPort() != _ancillaryPort)
>>>>                     {
>>>>                         if(receiver instanceof ReceiverBase)
>>>>                         {
>>>>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>>>>                         }
>>>>                     }
>>>>                 }
>>>>
>>>>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>>>>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>>>>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>>>>             }
>>>>             catch(ChannelException ex)
>>>>             {
>>>>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>>>>                 _tribesChannel = null;
>>>>                 throw new RuntimeException(ex); // todo, exception handling?
>>>>             }
>>>>         }
>>>>
>>>> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>>>>   
>>>>     
>>>>       
>>>>         
>>> the message you are getting is cause the membership tries to recover.
>>> you can limit this, by doing
>>> setRecoveryEnabled(true|false);
>>> setRecoveryCounter(nr-of-times-to-try-recover)
>>>
>>> also, you haven't added in the TCP failure detector, which adds one more 
>>> layer of protection
>>> see it in this default configuration
>>> http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
>>>
>>> you should still get the member disappeared error (eventually after the 
>>> timeout), if you can supply a simple test case, I can try it out over here.
>>>
>>> best
>>> Filip
>>>
>>>   
>>>     
>>>       
>>>> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>>>>
>>>> 	INFO: Done sleeping, membership established, start level:8
>>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
>>>> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
>>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
>>>> 	WARNING: Unable to send mcast message.
>>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>>> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
>>>> 	WARNING: Recovery thread failed to stop membership service.
>>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>>>> 	INFO: Setting cluster mcast soTimeout to 500
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
>>>> 	WARNING: Recovery thread failed to start membership service.
>>>> 	java.net.SocketException: error setting options
>>>> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
>>>> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
>>>> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>>> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
>>>> 	
>>>>   
>>>>     
>>>>       
>>>>         
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>   
>>>     
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


Re: Basic Tribes Questions

Posted by Peter Rossbach <pr...@objektpark.de>.
HI Mike,

tribes is part of tomcat. Yoo can find the svn repo links at

http://tomcat.apache.org/svn.html

Peter


Am 08.10.2008 um 17:18 schrieb Mike Wannamaker:

> Cool,
>
> Is there a repository to just get the tribes jar or just the tribes  
> source without having to get all of tomcat to get it?
>
> Like a SVN or CVS repository I could get the fix from and build  
> myself?
>
> Thanks
> Mike
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com]
> Sent: October 7, 2008 5:13 PM
> To: Tomcat Users List
> Subject: Re: Basic Tribes Questions
>
> hi Mike, that's great. yes, the TCP failure detector could give  
> multiple
> "DISAPPEARED" messages, that is something I'm about to fix
>
> Filip
>
> Mike Wannamaker wrote:
>> Hi Filip,
>>
>> I think I am seeing the message, it was just hidden amongst other  
>> log messages I guess I missed it.
>>
>> However I do see something else when I added the  
>> TcpFailureDetector to the interceptor list, I see two DISAPPEARED  
>> messages?
>>
>> Without TcpFailureDetector:
>>
>> 	1) Start Server #1, then #2
>> 	2) Unplug #2 network
>> 	3) On #1 - #2 DISAPPEARED, on #2 - #1 DISAPPEARED
>> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 -  
>> #1 ADDED
>>
>> Add TcpFailureDetector
>>
>> 	1) Start Server #1, #2
>> 	2) Unplug #2 network
>> 	3) On #1 - #2 DISAPPEARED;#2 DISAPPEARED, on #2 - #1  
>> DISAPPEARED;#1 DISAPPEARED
>> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 -  
>> #1 ADDED
>>
>> I take it I get the 2 DISAPPEARED messages because I have another  
>> interceptor, but is this the correct behaviour?
>>
>> TIA
>> Mike
>>
>>
>>
>> -----Original Message-----
>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com]
>> Sent: October 6, 2008 11:28 AM
>> To: Tomcat Users List
>> Subject: Re: Basic Tribes Questions
>>
>> there are getters and setters for everything
>> and they are all documented here
>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>
>> each component has getters/setters, for example, the multicast  
>> address
>>
>> setAddress
>> getAddress
>>
>> breakpoints might not work very well, since you are stopping one  
>> thread,
>> and not really emulating a real scenario.
>>
>> again, sounds like you have a simple test case, if you can share  
>> that, I
>> can get more understanding, and help you further.
>>
>> Filip
>>
>> Mike Wannamaker wrote:
>>
>>> Hi Filip
>>>
>>> Thanks for the info.  However, I don't see the documentation for  
>>> the setters/getters you mention below?
>>> Also I'm having issues while debugging.  When I hit a breakpoint  
>>> in my code and while stepping thru code, I get DISAPPEARED/ADDED  
>>> messages over and over on the other server?  I would think the  
>>> heartbeat is running in a separate thread for both send/receive?   
>>> How to solve this, bump the heartbeat timeout?
>>>
>>> TIA
>>> Mike
>>>
>>> -----Original Message-----
>>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com]
>>> Sent: October 3, 2008 2:51 PM
>>> To: Tomcat Users List
>>> Subject: Re: Basic Tribes Questions
>>>
>>> answers inline
>>>
>>> Mike Wannamaker wrote:
>>>
>>>
>>>> Hi, I am currently trying to use Tribes as the clustering layer  
>>>> on our server.
>>>>
>>>> My startup code looks like this.
>>>>
>>>>         if(_tribesChannel == null)
>>>>         { // nothing to do if already running
>>>>             try
>>>>             {
>>>>                 _tribesChannel = new GroupChannel();
>>>>                 // must be done before start:
>>>>
>>>>
>>>>
>>> no need to use any properties, there are getters and setters for  
>>> everything
>>> and they are all documented here
>>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>>
>>>
>>>>                 _tribesChannel.getMembershipService 
>>>> ().getProperties().put("mcastPort", String.valueOf(_mainPort));
>>>>                 _tribesChannel.getMembershipService 
>>>> ().getProperties().put("mcastAddress", _multicastIPAddr);
>>>>
>>>>
>>>>
>>> not sure what you are trying to do in the code below. if you  
>>> wanna set
>>> the port, then simply do it.
>>> the membership will pick it up automatically
>>>
>>>
>>>>                 if(_ancillaryPort > 0)
>>>>                 {
>>>>                     _tribesChannel.getMembershipService 
>>>> ().getProperties().put("tcpListenPort", String.valueOf 
>>>> (_ancillaryPort));
>>>>                     // hack alert: Default Tribes instantiation  
>>>> (Tomcat 6.0.16) does not read value for "tcpListenPort" from  
>>>> properties.
>>>>                     // Therefore, set it directly
>>>>                     ChannelReceiver receiver =  
>>>> _tribesChannel.getChannelReceiver();
>>>>                     if(receiver.getPort() != _ancillaryPort)
>>>>                     {
>>>>                         if(receiver instanceof ReceiverBase)
>>>>                         {
>>>>                             ((ReceiverBase)receiver).setPort 
>>>> (_ancillaryPort);
>>>>                         }
>>>>                     }
>>>>                 }
>>>>
>>>>                 _tribesChannel.addMembershipListener 
>>>> (_tribesMembershipListener);
>>>>                 _tribesChannel.addChannelListener 
>>>> (_tribesChannelListener);
>>>>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>>>>             }
>>>>             catch(ChannelException ex)
>>>>             {
>>>>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); }  
>>>> catch(Throwable t) { /*gulp*/}
>>>>                 _tribesChannel = null;
>>>>                 throw new RuntimeException(ex); // todo,  
>>>> exception handling?
>>>>             }
>>>>         }
>>>>
>>>> My Question is that when I start Server #1, then Server #2, then  
>>>> unplug Server #2 network cable, Server #1 gets the DISAPPEARED  
>>>> message but Server #2 just keeps logging the message below.  As  
>>>> I write this it's at attempt #120.  How do I get this to notify  
>>>> on Server #2 that Server #1 has DISAPPEARED or can I set the  
>>>> number of attempts to a maximum number before notifying?
>>>>
>>>>
>>>>
>>> the message you are getting is cause the membership tries to  
>>> recover.
>>> you can limit this, by doing
>>> setRecoveryEnabled(true|false);
>>> setRecoveryCounter(nr-of-times-to-try-recover)
>>>
>>> also, you haven't added in the TCP failure detector, which adds  
>>> one more
>>> layer of protection
>>> see it in this default configuration
>>> http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
>>>
>>> you should still get the member disappeared error (eventually  
>>> after the
>>> timeout), if you can supply a simple test case, I can try it out  
>>> over here.
>>>
>>> best
>>> Filip
>>>
>>>
>>>
>>>> Also is there any other documentation for tribes, other than the  
>>>> limited docs on the apache site?
>>>>
>>>> 	INFO: Done sleeping, membership established, start level:8
>>>> 	Oct 3, 2008 1:12:44 PM  
>>>> org.apache.catalina.tribes.transport.nio.NioReplicationTask run
>>>> 	WARNING: IOException in replication worker, unable to drain  
>>>> channel. Probable cause: Keep alive socket closed[An existing  
>>>> connection was 	forcibly closed by the remote host].
>>>> 	Oct 3, 2008 1:12:44 PM  
>>>> org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $SenderThread run
>>>> 	WARNING: Unable to send mcast message.
>>>> 	java.net.NoRouteToHostException: No route to host: Datagram  
>>>> send failed
>>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send 
>>>> (McastServiceImpl.java:385)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $SenderThread.run(McastServiceImpl.java:445)
>>>> 	Oct 3, 2008 1:12:49 PM  
>>>> org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $RecoveryThread run
>>>> 	INFO: Tribes membership, running recovery thread, multicasting  
>>>> is not functional.
>>>> 	Oct 3, 2008 1:12:49 PM  
>>>> org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $RecoveryThread stopService
>>>> 	WARNING: Recovery thread failed to stop membership service.
>>>> 	java.net.NoRouteToHostException: No route to host: Datagram  
>>>> send failed
>>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send 
>>>> (McastServiceImpl.java:385)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop 
>>>> (McastServiceImpl.java:299)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $RecoveryThread.stopService(McastServiceImpl.java:480)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $RecoveryThread.run(McastServiceImpl.java:504)
>>>> 	Oct 3, 2008 1:12:49 PM  
>>>> org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>>>> 	INFO: Setting cluster mcast soTimeout to 500
>>>> 	Oct 3, 2008 1:12:49 PM  
>>>> org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $RecoveryThread startService
>>>> 	WARNING: Recovery thread failed to start membership service.
>>>> 	java.net.SocketException: error setting options
>>>> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
>>>> 		at java.net.PlainDatagramSocketImpl.join 
>>>> (PlainDatagramSocketImpl.java:172)
>>>> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start 
>>>> (McastServiceImpl.java:233)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $RecoveryThread.startService(McastServiceImpl.java:490)
>>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $RecoveryThread.run(McastServiceImpl.java:504)
>>>> 	Oct 3, 2008 1:12:49 PM  
>>>> org.apache.catalina.tribes.membership.McastServiceImpl 
>>>> $RecoveryThread run
>>>> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
>>>> 	
>>>>
>>>>
>>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


RE: Basic Tribes Questions

Posted by Mike Wannamaker <mw...@opentext.com>.
Cool,

Is there a repository to just get the tribes jar or just the tribes source without having to get all of tomcat to get it?

Like a SVN or CVS repository I could get the fix from and build myself?

Thanks
Mike

-----Original Message-----
From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
Sent: October 7, 2008 5:13 PM
To: Tomcat Users List
Subject: Re: Basic Tribes Questions

hi Mike, that's great. yes, the TCP failure detector could give multiple 
"DISAPPEARED" messages, that is something I'm about to fix

Filip

Mike Wannamaker wrote:
> Hi Filip,
>
> I think I am seeing the message, it was just hidden amongst other log messages I guess I missed it.
>
> However I do see something else when I added the TcpFailureDetector to the interceptor list, I see two DISAPPEARED messages?
>
> Without TcpFailureDetector:
>
> 	1) Start Server #1, then #2
> 	2) Unplug #2 network
> 	3) On #1 - #2 DISAPPEARED, on #2 - #1 DISAPPEARED
> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>
> Add TcpFailureDetector
>
> 	1) Start Server #1, #2
> 	2) Unplug #2 network
> 	3) On #1 - #2 DISAPPEARED;#2 DISAPPEARED, on #2 - #1 DISAPPEARED;#1 DISAPPEARED
> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>
> I take it I get the 2 DISAPPEARED messages because I have another interceptor, but is this the correct behaviour?
>
> TIA
> Mike
>
>
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> Sent: October 6, 2008 11:28 AM
> To: Tomcat Users List
> Subject: Re: Basic Tribes Questions
>
> there are getters and setters for everything
> and they are all documented here
> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>
> each component has getters/setters, for example, the multicast address
>
> setAddress
> getAddress
>
> breakpoints might not work very well, since you are stopping one thread, 
> and not really emulating a real scenario.
>
> again, sounds like you have a simple test case, if you can share that, I 
> can get more understanding, and help you further.
>
> Filip
>
> Mike Wannamaker wrote:
>   
>> Hi Filip
>>
>> Thanks for the info.  However, I don't see the documentation for the setters/getters you mention below?
>> Also I'm having issues while debugging.  When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server?  I would think the heartbeat is running in a separate thread for both send/receive?  How to solve this, bump the heartbeat timeout?
>>
>> TIA
>> Mike
>>
>> -----Original Message-----
>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>> Sent: October 3, 2008 2:51 PM
>> To: Tomcat Users List
>> Subject: Re: Basic Tribes Questions
>>
>> answers inline
>>
>> Mike Wannamaker wrote:
>>   
>>     
>>> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>>>
>>> My startup code looks like this.
>>>
>>>         if(_tribesChannel == null)
>>>         { // nothing to do if already running
>>>             try
>>>             {
>>>                 _tribesChannel = new GroupChannel();
>>>                 // must be done before start:
>>>   
>>>     
>>>       
>> no need to use any properties, there are getters and setters for everything
>> and they are all documented here
>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>   
>>     
>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>>>   
>>>     
>>>       
>> not sure what you are trying to do in the code below. if you wanna set 
>> the port, then simply do it.
>> the membership will pick it up automatically
>>   
>>     
>>>                 if(_ancillaryPort > 0)
>>>                 {
>>>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>>>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>>>                     // Therefore, set it directly
>>>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>>>                     if(receiver.getPort() != _ancillaryPort)
>>>                     {
>>>                         if(receiver instanceof ReceiverBase)
>>>                         {
>>>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>>>                         }
>>>                     }
>>>                 }
>>>
>>>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>>>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>>>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>>>             }
>>>             catch(ChannelException ex)
>>>             {
>>>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>>>                 _tribesChannel = null;
>>>                 throw new RuntimeException(ex); // todo, exception handling?
>>>             }
>>>         }
>>>
>>> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>>>   
>>>     
>>>       
>> the message you are getting is cause the membership tries to recover.
>> you can limit this, by doing
>> setRecoveryEnabled(true|false);
>> setRecoveryCounter(nr-of-times-to-try-recover)
>>
>> also, you haven't added in the TCP failure detector, which adds one more 
>> layer of protection
>> see it in this default configuration
>> http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
>>
>> you should still get the member disappeared error (eventually after the 
>> timeout), if you can supply a simple test case, I can try it out over here.
>>
>> best
>> Filip
>>
>>   
>>     
>>> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>>>
>>> 	INFO: Done sleeping, membership established, start level:8
>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
>>> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
>>> 	WARNING: Unable to send mcast message.
>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
>>> 	WARNING: Recovery thread failed to stop membership service.
>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>>> 	INFO: Setting cluster mcast soTimeout to 500
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
>>> 	WARNING: Recovery thread failed to start membership service.
>>> 	java.net.SocketException: error setting options
>>> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
>>> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
>>> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
>>> 	
>>>   
>>>     
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


Re: Basic Tribes Questions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
hi Mike, that's great. yes, the TCP failure detector could give multiple 
"DISAPPEARED" messages, that is something I'm about to fix

Filip

Mike Wannamaker wrote:
> Hi Filip,
>
> I think I am seeing the message, it was just hidden amongst other log messages I guess I missed it.
>
> However I do see something else when I added the TcpFailureDetector to the interceptor list, I see two DISAPPEARED messages?
>
> Without TcpFailureDetector:
>
> 	1) Start Server #1, then #2
> 	2) Unplug #2 network
> 	3) On #1 - #2 DISAPPEARED, on #2 - #1 DISAPPEARED
> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>
> Add TcpFailureDetector
>
> 	1) Start Server #1, #2
> 	2) Unplug #2 network
> 	3) On #1 - #2 DISAPPEARED;#2 DISAPPEARED, on #2 - #1 DISAPPEARED;#1 DISAPPEARED
> 	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED
>
> I take it I get the 2 DISAPPEARED messages because I have another interceptor, but is this the correct behaviour?
>
> TIA
> Mike
>
>
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> Sent: October 6, 2008 11:28 AM
> To: Tomcat Users List
> Subject: Re: Basic Tribes Questions
>
> there are getters and setters for everything
> and they are all documented here
> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>
> each component has getters/setters, for example, the multicast address
>
> setAddress
> getAddress
>
> breakpoints might not work very well, since you are stopping one thread, 
> and not really emulating a real scenario.
>
> again, sounds like you have a simple test case, if you can share that, I 
> can get more understanding, and help you further.
>
> Filip
>
> Mike Wannamaker wrote:
>   
>> Hi Filip
>>
>> Thanks for the info.  However, I don't see the documentation for the setters/getters you mention below?
>> Also I'm having issues while debugging.  When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server?  I would think the heartbeat is running in a separate thread for both send/receive?  How to solve this, bump the heartbeat timeout?
>>
>> TIA
>> Mike
>>
>> -----Original Message-----
>> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
>> Sent: October 3, 2008 2:51 PM
>> To: Tomcat Users List
>> Subject: Re: Basic Tribes Questions
>>
>> answers inline
>>
>> Mike Wannamaker wrote:
>>   
>>     
>>> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>>>
>>> My startup code looks like this.
>>>
>>>         if(_tribesChannel == null)
>>>         { // nothing to do if already running
>>>             try
>>>             {
>>>                 _tribesChannel = new GroupChannel();
>>>                 // must be done before start:
>>>   
>>>     
>>>       
>> no need to use any properties, there are getters and setters for everything
>> and they are all documented here
>> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>>   
>>     
>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>>>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>>>   
>>>     
>>>       
>> not sure what you are trying to do in the code below. if you wanna set 
>> the port, then simply do it.
>> the membership will pick it up automatically
>>   
>>     
>>>                 if(_ancillaryPort > 0)
>>>                 {
>>>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>>>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>>>                     // Therefore, set it directly
>>>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>>>                     if(receiver.getPort() != _ancillaryPort)
>>>                     {
>>>                         if(receiver instanceof ReceiverBase)
>>>                         {
>>>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>>>                         }
>>>                     }
>>>                 }
>>>
>>>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>>>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>>>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>>>             }
>>>             catch(ChannelException ex)
>>>             {
>>>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>>>                 _tribesChannel = null;
>>>                 throw new RuntimeException(ex); // todo, exception handling?
>>>             }
>>>         }
>>>
>>> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>>>   
>>>     
>>>       
>> the message you are getting is cause the membership tries to recover.
>> you can limit this, by doing
>> setRecoveryEnabled(true|false);
>> setRecoveryCounter(nr-of-times-to-try-recover)
>>
>> also, you haven't added in the TCP failure detector, which adds one more 
>> layer of protection
>> see it in this default configuration
>> http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
>>
>> you should still get the member disappeared error (eventually after the 
>> timeout), if you can supply a simple test case, I can try it out over here.
>>
>> best
>> Filip
>>
>>   
>>     
>>> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>>>
>>> 	INFO: Done sleeping, membership established, start level:8
>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
>>> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
>>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
>>> 	WARNING: Unable to send mcast message.
>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
>>> 	WARNING: Recovery thread failed to stop membership service.
>>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>>> 	INFO: Setting cluster mcast soTimeout to 500
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
>>> 	WARNING: Recovery thread failed to start membership service.
>>> 	java.net.SocketException: error setting options
>>> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
>>> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
>>> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
>>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>>> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
>>> 	
>>>   
>>>     
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


RE: Basic Tribes Questions

Posted by Mike Wannamaker <mw...@opentext.com>.
Hi Filip,

I think I am seeing the message, it was just hidden amongst other log messages I guess I missed it.

However I do see something else when I added the TcpFailureDetector to the interceptor list, I see two DISAPPEARED messages?

Without TcpFailureDetector:

	1) Start Server #1, then #2
	2) Unplug #2 network
	3) On #1 - #2 DISAPPEARED, on #2 - #1 DISAPPEARED
	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED

Add TcpFailureDetector

	1) Start Server #1, #2
	2) Unplug #2 network
	3) On #1 - #2 DISAPPEARED;#2 DISAPPEARED, on #2 - #1 DISAPPEARED;#1 DISAPPEARED
	4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED

I take it I get the 2 DISAPPEARED messages because I have another interceptor, but is this the correct behaviour?

TIA
Mike



-----Original Message-----
From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
Sent: October 6, 2008 11:28 AM
To: Tomcat Users List
Subject: Re: Basic Tribes Questions

there are getters and setters for everything
and they are all documented here
http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html

each component has getters/setters, for example, the multicast address

setAddress
getAddress

breakpoints might not work very well, since you are stopping one thread, 
and not really emulating a real scenario.

again, sounds like you have a simple test case, if you can share that, I 
can get more understanding, and help you further.

Filip

Mike Wannamaker wrote:
> Hi Filip
>
> Thanks for the info.  However, I don't see the documentation for the setters/getters you mention below?
> Also I'm having issues while debugging.  When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server?  I would think the heartbeat is running in a separate thread for both send/receive?  How to solve this, bump the heartbeat timeout?
>
> TIA
> Mike
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> Sent: October 3, 2008 2:51 PM
> To: Tomcat Users List
> Subject: Re: Basic Tribes Questions
>
> answers inline
>
> Mike Wannamaker wrote:
>   
>> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>>
>> My startup code looks like this.
>>
>>         if(_tribesChannel == null)
>>         { // nothing to do if already running
>>             try
>>             {
>>                 _tribesChannel = new GroupChannel();
>>                 // must be done before start:
>>   
>>     
> no need to use any properties, there are getters and setters for everything
> and they are all documented here
> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>   
>>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>>   
>>     
> not sure what you are trying to do in the code below. if you wanna set 
> the port, then simply do it.
> the membership will pick it up automatically
>   
>>                 if(_ancillaryPort > 0)
>>                 {
>>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>>                     // Therefore, set it directly
>>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>>                     if(receiver.getPort() != _ancillaryPort)
>>                     {
>>                         if(receiver instanceof ReceiverBase)
>>                         {
>>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>>                         }
>>                     }
>>                 }
>>
>>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>>             }
>>             catch(ChannelException ex)
>>             {
>>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>>                 _tribesChannel = null;
>>                 throw new RuntimeException(ex); // todo, exception handling?
>>             }
>>         }
>>
>> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>>   
>>     
> the message you are getting is cause the membership tries to recover.
> you can limit this, by doing
> setRecoveryEnabled(true|false);
> setRecoveryCounter(nr-of-times-to-try-recover)
>
> also, you haven't added in the TCP failure detector, which adds one more 
> layer of protection
> see it in this default configuration
> http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
>
> you should still get the member disappeared error (eventually after the 
> timeout), if you can supply a simple test case, I can try it out over here.
>
> best
> Filip
>
>   
>> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>>
>> 	INFO: Done sleeping, membership established, start level:8
>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
>> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
>> 	WARNING: Unable to send mcast message.
>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
>> 	WARNING: Recovery thread failed to stop membership service.
>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>> 	INFO: Setting cluster mcast soTimeout to 500
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
>> 	WARNING: Recovery thread failed to start membership service.
>> 	java.net.SocketException: error setting options
>> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
>> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
>> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
>> 	
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


Re: Basic Tribes Questions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
there are getters and setters for everything
and they are all documented here
http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html

each component has getters/setters, for example, the multicast address

setAddress
getAddress

breakpoints might not work very well, since you are stopping one thread, 
and not really emulating a real scenario.

again, sounds like you have a simple test case, if you can share that, I 
can get more understanding, and help you further.

Filip

Mike Wannamaker wrote:
> Hi Filip
>
> Thanks for the info.  However, I don't see the documentation for the setters/getters you mention below?
> Also I'm having issues while debugging.  When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server?  I would think the heartbeat is running in a separate thread for both send/receive?  How to solve this, bump the heartbeat timeout?
>
> TIA
> Mike
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> Sent: October 3, 2008 2:51 PM
> To: Tomcat Users List
> Subject: Re: Basic Tribes Questions
>
> answers inline
>
> Mike Wannamaker wrote:
>   
>> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>>
>> My startup code looks like this.
>>
>>         if(_tribesChannel == null)
>>         { // nothing to do if already running
>>             try
>>             {
>>                 _tribesChannel = new GroupChannel();
>>                 // must be done before start:
>>   
>>     
> no need to use any properties, there are getters and setters for everything
> and they are all documented here
> http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>   
>>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>>   
>>     
> not sure what you are trying to do in the code below. if you wanna set 
> the port, then simply do it.
> the membership will pick it up automatically
>   
>>                 if(_ancillaryPort > 0)
>>                 {
>>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>>                     // Therefore, set it directly
>>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>>                     if(receiver.getPort() != _ancillaryPort)
>>                     {
>>                         if(receiver instanceof ReceiverBase)
>>                         {
>>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>>                         }
>>                     }
>>                 }
>>
>>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>>             }
>>             catch(ChannelException ex)
>>             {
>>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>>                 _tribesChannel = null;
>>                 throw new RuntimeException(ex); // todo, exception handling?
>>             }
>>         }
>>
>> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>>   
>>     
> the message you are getting is cause the membership tries to recover.
> you can limit this, by doing
> setRecoveryEnabled(true|false);
> setRecoveryCounter(nr-of-times-to-try-recover)
>
> also, you haven't added in the TCP failure detector, which adds one more 
> layer of protection
> see it in this default configuration
> http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html
>
> you should still get the member disappeared error (eventually after the 
> timeout), if you can supply a simple test case, I can try it out over here.
>
> best
> Filip
>
>   
>> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>>
>> 	INFO: Done sleeping, membership established, start level:8
>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
>> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
>> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
>> 	WARNING: Unable to send mcast message.
>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
>> 	WARNING: Recovery thread failed to stop membership service.
>> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
>> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
>> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
>> 	INFO: Setting cluster mcast soTimeout to 500
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
>> 	WARNING: Recovery thread failed to start membership service.
>> 	java.net.SocketException: error setting options
>> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
>> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
>> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
>> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
>> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
>> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
>> 	
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


RE: Basic Tribes Questions

Posted by Mike Wannamaker <mw...@opentext.com>.
Hi Filip

Thanks for the info.  However, I don't see the documentation for the setters/getters you mention below?
Also I'm having issues while debugging.  When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server?  I would think the heartbeat is running in a separate thread for both send/receive?  How to solve this, bump the heartbeat timeout?

TIA
Mike

-----Original Message-----
From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
Sent: October 3, 2008 2:51 PM
To: Tomcat Users List
Subject: Re: Basic Tribes Questions

answers inline

Mike Wannamaker wrote:
> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>
> My startup code looks like this.
>
>         if(_tribesChannel == null)
>         { // nothing to do if already running
>             try
>             {
>                 _tribesChannel = new GroupChannel();
>                 // must be done before start:
>   
no need to use any properties, there are getters and setters for everything
and they are all documented here
http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>   
not sure what you are trying to do in the code below. if you wanna set 
the port, then simply do it.
the membership will pick it up automatically
>                 if(_ancillaryPort > 0)
>                 {
>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>                     // Therefore, set it directly
>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>                     if(receiver.getPort() != _ancillaryPort)
>                     {
>                         if(receiver instanceof ReceiverBase)
>                         {
>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>                         }
>                     }
>                 }
>
>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>             }
>             catch(ChannelException ex)
>             {
>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>                 _tribesChannel = null;
>                 throw new RuntimeException(ex); // todo, exception handling?
>             }
>         }
>
> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>   
the message you are getting is cause the membership tries to recover.
you can limit this, by doing
setRecoveryEnabled(true|false);
setRecoveryCounter(nr-of-times-to-try-recover)

also, you haven't added in the TCP failure detector, which adds one more 
layer of protection
see it in this default configuration
http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html

you should still get the member disappeared error (eventually after the 
timeout), if you can supply a simple test case, I can try it out over here.

best
Filip

> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>
> 	INFO: Done sleeping, membership established, start level:8
> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
> 	WARNING: Unable to send mcast message.
> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
> 	WARNING: Recovery thread failed to stop membership service.
> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
> 	INFO: Setting cluster mcast soTimeout to 500
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
> 	WARNING: Recovery thread failed to start membership service.
> 	java.net.SocketException: error setting options
> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
> 	
>   


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


Re: Basic Tribes Questions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
answers inline

Mike Wannamaker wrote:
> Hi, I am currently trying to use Tribes as the clustering layer on our server.
>
> My startup code looks like this.
>
>         if(_tribesChannel == null)
>         { // nothing to do if already running
>             try
>             {
>                 _tribesChannel = new GroupChannel();
>                 // must be done before start:
>   
no need to use any properties, there are getters and setters for everything
and they are all documented here
http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html
>                 _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
>                 _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
>   
not sure what you are trying to do in the code below. if you wanna set 
the port, then simply do it.
the membership will pick it up automatically
>                 if(_ancillaryPort > 0)
>                 {
>                     _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
>                     // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
>                     // Therefore, set it directly
>                     ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
>                     if(receiver.getPort() != _ancillaryPort)
>                     {
>                         if(receiver instanceof ReceiverBase)
>                         {
>                             ((ReceiverBase)receiver).setPort(_ancillaryPort);
>                         }
>                     }
>                 }
>
>                 _tribesChannel.addMembershipListener(_tribesMembershipListener);
>                 _tribesChannel.addChannelListener(_tribesChannelListener);
>                 _tribesChannel.start(CHANNEL_COMPONENTS);
>             }
>             catch(ChannelException ex)
>             {
>                 try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
>                 _tribesChannel = null;
>                 throw new RuntimeException(ex); // todo, exception handling?
>             }
>         }
>
> My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?
>   
the message you are getting is cause the membership tries to recover.
you can limit this, by doing
setRecoveryEnabled(true|false);
setRecoveryCounter(nr-of-times-to-try-recover)

also, you haven't added in the TCP failure detector, which adds one more 
layer of protection
see it in this default configuration
http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html

you should still get the member disappeared error (eventually after the 
timeout), if you can supply a simple test case, I can try it out over here.

best
Filip

> Also is there any other documentation for tribes, other than the limited docs on the apache site?
>
> 	INFO: Done sleeping, membership established, start level:8
> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
> 	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
> 	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
> 	WARNING: Unable to send mcast message.
> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
> 	INFO: Tribes membership, running recovery thread, multicasting is not functional.
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
> 	WARNING: Recovery thread failed to stop membership service.
> 	java.net.NoRouteToHostException: No route to host: Datagram send failed
> 		at java.net.PlainDatagramSocketImpl.send(Native Method)
> 		at java.net.DatagramSocket.send(DatagramSocket.java:612)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
> 	INFO: Setting cluster mcast soTimeout to 500
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
> 	WARNING: Recovery thread failed to start membership service.
> 	java.net.SocketException: error setting options
> 		at java.net.PlainDatagramSocketImpl.join(Native Method)
> 		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
> 		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
> 		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
> 	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
> 	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
> 	
>   


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


Basic Tribes Questions

Posted by Mike Wannamaker <mw...@opentext.com>.
Hi, I am currently trying to use Tribes as the clustering layer on our server.

My startup code looks like this.

        if(_tribesChannel == null)
        { // nothing to do if already running
            try
            {
                _tribesChannel = new GroupChannel();
                // must be done before start:
                _tribesChannel.getMembershipService().getProperties().put("mcastPort", String.valueOf(_mainPort));
                _tribesChannel.getMembershipService().getProperties().put("mcastAddress", _multicastIPAddr);
                if(_ancillaryPort > 0)
                {
                    _tribesChannel.getMembershipService().getProperties().put("tcpListenPort", String.valueOf(_ancillaryPort));
                    // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for "tcpListenPort" from properties.
                    // Therefore, set it directly
                    ChannelReceiver receiver = _tribesChannel.getChannelReceiver();
                    if(receiver.getPort() != _ancillaryPort)
                    {
                        if(receiver instanceof ReceiverBase)
                        {
                            ((ReceiverBase)receiver).setPort(_ancillaryPort);
                        }
                    }
                }

                _tribesChannel.addMembershipListener(_tribesMembershipListener);
                _tribesChannel.addChannelListener(_tribesChannelListener);
                _tribesChannel.start(CHANNEL_COMPONENTS);
            }
            catch(ChannelException ex)
            {
                try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
                _tribesChannel = null;
                throw new RuntimeException(ex); // todo, exception handling?
            }
        }

My Question is that when I start Server #1, then Server #2, then unplug Server #2 network cable, Server #1 gets the DISAPPEARED message but Server #2 just keeps logging the message below.  As I write this it's at attempt #120.  How do I get this to notify on Server #2 that Server #1 has DISAPPEARED or can I set the number of attempts to a maximum number before notifying?

Also is there any other documentation for tribes, other than the limited docs on the apache site?

	INFO: Done sleeping, membership established, start level:8
	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.transport.nio.NioReplicationTask run
	WARNING: IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed[An existing connection was 	forcibly closed by the remote host].
	Oct 3, 2008 1:12:44 PM org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread run
	WARNING: Unable to send mcast message.
	java.net.NoRouteToHostException: No route to host: Datagram send failed
		at java.net.PlainDatagramSocketImpl.send(Native Method)
		at java.net.DatagramSocket.send(DatagramSocket.java:612)
		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
		at org.apache.catalina.tribes.membership.McastServiceImpl$SenderThread.run(McastServiceImpl.java:445)
	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
	INFO: Tribes membership, running recovery thread, multicasting is not functional.
	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread stopService
	WARNING: Recovery thread failed to stop membership service.
	java.net.NoRouteToHostException: No route to host: Datagram send failed
		at java.net.PlainDatagramSocketImpl.send(Native Method)
		at java.net.DatagramSocket.send(DatagramSocket.java:612)
		at org.apache.catalina.tribes.membership.McastServiceImpl.send(McastServiceImpl.java:385)
		at org.apache.catalina.tribes.membership.McastServiceImpl.stop(McastServiceImpl.java:299)
		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.stopService(McastServiceImpl.java:480)
		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
	INFO: Setting cluster mcast soTimeout to 500
	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread startService
	WARNING: Recovery thread failed to start membership service.
	java.net.SocketException: error setting options
		at java.net.PlainDatagramSocketImpl.join(Native Method)
		at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
		at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
		at org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServiceImpl.java:233)
		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.startService(McastServiceImpl.java:490)
		at org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread.run(McastServiceImpl.java:504)
	Oct 3, 2008 1:12:49 PM org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread run
	INFO: Recovery attempt 1 failed, trying again in 5000 seconds
	

Re: Tomcat JVM not releasing deleted files (lsof show delete inodes taking up disk space)

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

Chad,

Chad Kellerman wrote:
> It's actually a vendor supplied application.  I filed a bug/support request
> and they returned with a patch.

Were you able to inspect the patch? I'm interested to see what they
chose to do.

> I guess I was wondering if there were any jvm startup options I may have
> over looked that may help with this sort of issues.  But it definitely seems
> to be a coding issue.

No, I don't think that the JVM does anything like this unless you ask it
to. I suspect that File.deleteOnExit is being used by programmers who
didn't realize the implications on long-running processes.

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

iEYEARECAAYFAkjmMC0ACgkQ9CaO5/Lv0PBMHwCfZfzk7htsD9itW+sPLGwd4vgw
ByUAoIEkRUOAkkdAHkD1WhXOf/Uo3zuI
=OeI4
-----END PGP SIGNATURE-----

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


Re: Tomcat JVM not releasing deleted files (lsof show delete inodes taking up disk space)

Posted by Chad Kellerman <su...@gmail.com>.
It's actually a vendor supplied application.  I filed a bug/support request
and they returned with a patch.

I guess I was wondering if there were any jvm startup options I may have
over looked that may help with this sort of issues.  But it definitely seems
to be a coding issue.


Thanks,
Chad

On Thu, Oct 2, 2008 at 2:27 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Chad,
>
> Chad Kellerman wrote:
> > To get a better understanding... the application indexes
> > uploaded files, the indexing process creates the temporary files then
> > removes them.
>
> Can you share the code that actually does this? The javadoc for
> File.createTempFile states:
>
> "To arrange for a file created by this method to be deleted
> automatically, use the deleteOnExit() method."
>
> If your engineers followed this advice, this may be your problem: the
> JVM is waiting until JVM shutdown to actually delete the files. Even if
> the code does an explicit File.delete(), the JVM is probably still
> hanging onto a reference to the file's directory entry in order to
> delete it on exit. That seems like a plausible explanation for why the
> files are marked as "deleted" in lsof, but are still being kept alive by
> the JVM.
>
> The solution here would be to simply not use File.deleteOnExit; instead,
> use File.delete explicitly.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkjlEpIACgkQ9CaO5/Lv0PBo0wCfRhUitB/6/pxDQiGtbdo0Ctwk
> qj4AnjuQwMY3yduWoAN5/InlbZnX1CW6
> =i6Uc
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>