-
1. Re: Detect cluster node failure Jboss AS 7.1.1-Final
wdfink Feb 5, 2013 3:01 PM (in response to manishdevraj)I wonder wheter this can be achieved with an implementation which uses the management interface
-
2. Re: Detect cluster node failure Jboss AS 7.1.1-Final
rhusar Feb 6, 2013 6:52 AM (in response to manishdevraj)1 of 1 people found this helpfulI am not really sure what you want to achieve. If you want to delete data of the failed node, why replicated in the first place? Just use a local cache and if the node goes down the data is gone. If you need the data on other nodes, use REPL or DIST and data is accessible everywhere.
Either way, to do what you want, you can just implement a cache listener that listens on evens of membership change like this:
@ManagedBean @Listener public class MyBean { @Resource(lookup="java:jboss/infinispan/container/web") private EmbeddedCacheManager manager; @PostConstruct public void init() { manager.addListener(this); } @PreDestroy public void destroy() { manager.removeListener(this); } @ViewChanged public void viewChanged(ViewChangedEvent event) { // Insert your cleanup logic } }
-
3. Re: Detect cluster node failure Jboss AS 7.1.1-Final
manishdevraj Feb 6, 2013 7:25 AM (in response to rhusar)You are correct, but since I am using clustering the information is getting replicated across the cluster nodes. Problem is when my job runs to check active users from cache it will return all the records irrespective of the fact that one of the server who was handling the record has failed/crashed. In such scenario I would like to clean up the records of node that failed. You approach seems good to me, I am going to try and get back for others looking for similar solutions.
Thank you
-
4. Re: Detect cluster node failure Jboss AS 7.1.1-Final
rhusar Feb 6, 2013 7:47 AM (in response to manishdevraj)irrespective of the fact that one of the server who was handling the record has failed/crashed
I still don't quite understand. That's the point of using clustering to achieve highly-available deployment. One of the core attributes of such system is faul tolerance, meaning in case of failure, system runs correctly further. So that's why no cleaning is neccessary. But I guess you have a specific use case.