# Callback method for java, if any of the node is down

**URL:** https://discuss.elastic.co/t/callback-method-for-java-if-any-of-the-node-is-down/14533
**Category:** Elasticsearch
**Created:** [November 22, 2013, 5:33am UTC](https://discuss.elastic.co/t/callback-method-for-java-if-any-of-the-node-is-down/14533 "2013-11-22T05:33:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![akram79](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@akram79](https://discuss.elastic.co/u/akram79)
#### Post date: [November 22, 2013, 5:33am UTC](https://discuss.elastic.co/t/callback-method-for-java-if-any-of-the-node-is-down/14533/1 "2013-11-22T05:33:30Z")

</div>

Hi,

Is it possible, to have some Listener when any one of the node in the  
cluster is down.

As a requirement, If the cluster is down, application should be stopped,  
now it is done by using thread, which checks cluster health for every 10  
minutes.

Instead of this, can we have some call back listener to java code, so that  
once any node is down, the call back method will be called.

Regards,  
Akram.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [November 22, 2013, 8:32am UTC](https://discuss.elastic.co/t/callback-method-for-java-if-any-of-the-node-is-down/14533/2 "2013-11-22T08:32:13Z")

</div>

Hey,

the ZenDiscovery class in elasticsearch uses listeners for node and master  
failures, if you want to go that road. However I am really wondering, why  
do you want to stop the application? Wouldnt it make more sense to have a  
cluster, which has several replicas of each shard, so that in the case of  
one node going down you do not have data loss or even cluster stability  
issues?  
Would be interested in your use case and the motivation behind it, as it  
sounds from my naive outside point of view, that this is not the best  
solution to solve.

--Alex

On Fri, Nov 22, 2013 at 6:33 AM, Akram Hussain  
[akram.hussain.sk@gmail.com](mailto:akram.hussain.sk@gmail.com)wrote:

> Hi,
> 
> Is it possible, to have some Listener when any one of the node in the  
> cluster is down.
> 
> As a requirement, If the cluster is down, application should be stopped,  
> now it is done by using thread, which checks cluster health for every 10  
> minutes.
> 
> Instead of this, can we have some call back listener to java code, so that  
> once any node is down, the call back method will be called.
> 
> Regards,  
> Akram.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![akram79](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@akram79](https://discuss.elastic.co/u/akram79)
#### Post date: [November 22, 2013, 11:33am UTC](https://discuss.elastic.co/t/callback-method-for-java-if-any-of-the-node-is-down/14533/3 "2013-11-22T11:33:00Z")

</div>

Hi,

I mean the cluster, if total cluster servers are not available/closed, just  
get call back method saying cluster nodes are not avaialble.

How to register with ZenDiscovery class, can you suggest me the way it  
needs to be achieved.

Regards,  
Akram.

On Friday, November 22, 2013 2:02:13 PM UTC+5:30, Alexander Reelsen wrote:

> Hey,
> 
> the ZenDiscovery class in elasticsearch uses listeners for node and master  
> failures, if you want to go that road. However I am really wondering, why  
> do you want to stop the application? Wouldnt it make more sense to have a  
> cluster, which has several replicas of each shard, so that in the case of  
> one node going down you do not have data loss or even cluster stability  
> issues?  
> Would be interested in your use case and the motivation behind it, as it  
> sounds from my naive outside point of view, that this is not the best  
> solution to solve.
> 
> --Alex
> 
> On Fri, Nov 22, 2013 at 6:33 AM, Akram Hussain \<[akram.hu...@gmail.com](mailto:akram.hu...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi,
> > 
> > Is it possible, to have some Listener when any one of the node in the  
> > cluster is down.
> > 
> > As a requirement, If the cluster is down, application should be stopped,  
> > now it is done by using thread, which checks cluster health for every 10  
> > minutes.
> > 
> > Instead of this, can we have some call back listener to java code, so  
> > that once any node is down, the call back method will be called.
> > 
> > Regards,  
> > Akram.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![akram79](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@akram79](https://discuss.elastic.co/u/akram79)
#### Post date: [November 27, 2013, 10:24am UTC](https://discuss.elastic.co/t/callback-method-for-java-if-any-of-the-node-is-down/14533/4 "2013-11-27T10:24:09Z")

</div>

Hi,

Gentle Remainder.

Regards,  
Akram.

On Friday, November 22, 2013 5:03:00 PM UTC+5:30, Akram Hussain wrote:

> Hi,
> 
> I mean the cluster, if total cluster servers are not available/closed,  
> just get call back method saying cluster nodes are not avaialble.
> 
> How to register with ZenDiscovery class, can you suggest me the way it  
> needs to be achieved.
> 
> Regards,  
> Akram.
> 
> On Friday, November 22, 2013 2:02:13 PM UTC+5:30, Alexander Reelsen wrote:
> 
> > Hey,
> > 
> > the ZenDiscovery class in elasticsearch uses listeners for node and  
> > master failures, if you want to go that road. However I am really  
> > wondering, why do you want to stop the application? Wouldnt it make more  
> > sense to have a cluster, which has several replicas of each shard, so that  
> > in the case of one node going down you do not have data loss or even  
> > cluster stability issues?  
> > Would be interested in your use case and the motivation behind it, as it  
> > sounds from my naive outside point of view, that this is not the best  
> > solution to solve.
> > 
> > --Alex
> > 
> > On Fri, Nov 22, 2013 at 6:33 AM, Akram Hussain [akram.hu...@gmail.com](mailto:akram.hu...@gmail.com)wrote:
> > 
> > > Hi,
> > > 
> > > Is it possible, to have some Listener when any one of the node in the  
> > > cluster is down.
> > > 
> > > As a requirement, If the cluster is down, application should be stopped,  
> > > now it is done by using thread, which checks cluster health for every 10  
> > > minutes.
> > > 
> > > Instead of this, can we have some call back listener to java code, so  
> > > that once any node is down, the call back method will be called.
> > > 
> > > Regards,  
> > > Akram.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cf66016e-75be-4313-9ac5-620082213c27%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cf66016e-75be-4313-9ac5-620082213c27%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:04am UTC](https://discuss.elastic.co/t/callback-method-for-java-if-any-of-the-node-is-down/14533/5 "2017-07-06T02:04:38Z")

</div>


