1 Reply Latest reply on Feb 20, 2008 7:04 AM by mircea.markus

    Finding out when a node leaves

    khkachn

      Hi,

      Maybe I asked this in the wrong topic, sorry if this is a cross post.

      Is it possible to determine or get an event sent when a node leaves the cluster? What I want to do is check in a TreeCache if the node had any work assigned to it and have one of the other nodes take over. That means I would also need a way for the remaining nodes to coordinate the take over, if there is also a good way to do that.

      Thanks,

      Ken

        • 1. Re: Finding out when a node leaves
          mircea.markus

           

          Is it possible to determine or get an event sent when a node leaves the cluster?

          yes, you should register to the cache as a cache listeners on view changed event. Use treeCache.addTreeCacheListener(TreeCacheListene), and make your listener handle cluster topology change through implementing TreeCacheListene.viewChange(newView)
          What I want to do is check in a TreeCache if the node had any work assigned to it and have one of the other nodes take over.

          what do you mean by 'had any work assigned to it'? You can use (buddy)replication for having one node's data in some other nodes(s), so that if one node fails/(is removed from the cluster) then the data still exists and can be processed from the backups.