当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Hazelcast : shutting down a particular member from hazelcast cluster

问题描述:

I am using hazelcast with spring MVC and loading the instance with context.

Now because of a bug in spring code sometimes my context gets reloaded.

And whenever spring context reloads hazelcast creates a new member in its cluster.

I am working to solve the bug in spring but till than i wanted to know that how can i close particular member of hazelcast cluster without affecting rest of the members.

Thanks.

网友答案:

I have faced this problem recently. My only solution was to create a servlet context listener associated with spring servlet dispatcher and shutdown hazelcast instance on "contextDextroyed" event.

Hope this helps.

网友答案:

All you need to do is get a shutdown hook created when the context initialized and call shutdown method (read manual for that) when context exits.

分享给朋友:
您可能感兴趣的文章:
随机阅读: