Hazelcast: notify when a cluster node dies

2019-09-20 16:46发布

问题:

I am quite a newbie to Hazelcast.
I'm building a cluster where different nodes take in charge different activities.
When a node dies, I'd like other nodes to notice, so they can reassign the dead node's activities among themselves. Is this possible? I have already made some research for this, but I couldn't find anything useful. Any help would be appreciated :)

回答1:

There are a number of ways here, probably the simplest for what you describe is http://docs.hazelcast.org/docs/3.8.5/javadoc/com/hazelcast/core/MembershipListener.html

However, you don't really want nodes dying in the first place, that's probably worth resolving.

Plus, it sounds like you're trying to manage workload placement yourself, simpler to let Hazelcast do it for you -- with for example with semaphores.