Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to shut down a Hazelcast instance in a JVM?

My Java code started numbers of Hazelcast instances in the same JVM (but they are in the same group).

Now I want to shut down some of instances, but not all of them.

I know the method Hazelcast.shutdownAll() - this method closes all of the instances. Is there a method that allows to close a specific instance?

like image 516
Winston Avatar asked Sep 26 '13 08:09

Winston


2 Answers

It's very easy - here is the code:

HazelcastInstance instance =  Hazelcast.newHazelcastInstance(config);

instance.getLifecycleService().shutdown();
like image 117
Winston Avatar answered Oct 11 '22 11:10

Winston


That is correct.

Depending on the Hazelcast version, you can also call hazelcastInstance.shutdown().

like image 20
pveentjer Avatar answered Oct 11 '22 12:10

pveentjer