ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamal C <kamaltar...@gmail.com>
Subject Re: How to stop a IgniteService gracefully?
Date Mon, 11 Jul 2016 04:30:16 GMT
Vladislav,

I've applied your suggestion. Still, Ignite closes the service running in
all the nodes,

ClusterGroup grp = ignite.cluster().forNode(ignite.cluster().localNode());
ignite.services(grp).cancel(calcService);


*Exception*
class org.apache.ignite.IgniteException: Failed to find deployed service:
CalcService
    at
org.apache.ignite.internal.processors.service.GridServiceProxy.invokeMethod(GridServiceProxy.java:155)
    at
org.apache.ignite.internal.processors.service.GridServiceProxy$ProxyInvocationHandler.invoke(GridServiceProxy.java:331)
    at com.sun.proxy.$Proxy28.add(Unknown Source)
    at
my.apache.ignite.examples.servicegrid.ServiceDeployer.useService(ServiceDeployer.java:63)


Re-framing my question:

-  Is Service.cancel() method is not a appropriate place for resource
cleanups on shutdown?
-  How to tell Ignite to move a clustered singleton service from one node
to another with external scripts?

-- Kamal

On Sat, Jul 9, 2016 at 1:07 AM, Vladislav Pyatkov <vldpyatkov@gmail.com>
wrote:

> Hello Kamal,
>
> Try to use Ignite.services(ClusterGroup
> <http://ignite.apache.org/releases/1.0.0/javadoc/org/apache/ignite/cluster/ClusterGroup.html>
grp)
> for local node group.
>
>
> *Ignition.ignite().services(Ignition.ignite().cluster().localNode()).cancel(serviceName);*
>
> On Fri, Jul 8, 2016 at 9:48 AM, Kamal C <kamaltarget@gmail.com> wrote:
>
>> Hi,
>>
>>     I have a 3 node Ignite cluster and deployed a service using Node
>> Singleton approach. The service started to run in all the 3 nodes.
>>
>> Whenever a node stopped, the below line gets called as I'm doing resource
>> cleanups inside *IgniteService.cancel(ServiceContext context)* method.
>>
>> *Ignition.ignite().services().cancel(serviceName);*
>>
>> But, it cancels the service from all the nodes. How to cancel a locally
>> running Ignite service gracefully?
>>
>> --
>> Kamal
>>
>
>
>
> --
> Vladislav Pyatkov
>

Mime
View raw message