# How to get the cluster running status using java elastic API?

**URL:** <https://discuss.elastic.co/t/how-to-get-the-cluster-running-status-using-java-elastic-api/5255>\
**Category:** Elasticsearch\
**Created:** [August 26, 2011, 5:36am UTC](https://discuss.elastic.co/t/how-to-get-the-cluster-running-status-using-java-elastic-api/5255 "2011-08-26T05:36:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [August 26, 2011, 5:36am UTC](https://discuss.elastic.co/t/how-to-get-the-cluster-running-status-using-java-elastic-api/5255/1 "2011-08-26T05:36:06Z")

</div>

Hi

I want to check whether elastic search server running or not and which  
state it give me information that server running nicely.

Thanks

---

<div class="post-metadata">

**Author:** ![Kun\_Niu](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@Kun\_Niu](https://discuss.elastic.co/u/Kun_Niu)\
**Post date:** [August 26, 2011, 5:37am UTC](https://discuss.elastic.co/t/how-to-get-the-cluster-running-status-using-java-elastic-api/5255/2 "2011-08-26T05:37:25Z")

</div>

You can try admin method from trasportclient class.

> -----Original Message-----  
> From: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] On Behalf Of sam  
> Sent: 2011年8月26日 13:36  
> To: elasticsearch  
> Subject: How to get the cluster running status using java elastic API?
> 
> Hi
> 
> I want to check whether Elasticsearch server running or not and which  
> state  
> it give me information that server running nicely.
> 
> Thanks

---

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [August 26, 2011, 6:00am UTC](https://discuss.elastic.co/t/how-to-get-the-cluster-running-status-using-java-elastic-api/5255/3 "2011-08-26T06:00:45Z")

</div>

Thanks for your reply.but i'm not connect remotely to an elasticsearch  
cluster.which class and method will help me to get for local servers  
status. also any available document that help me to understand  
elastic java library beside available java docs for that.

On Aug 26, 10:37 am, "Kun Niu" [haoniu...@gmail.com](mailto:haoniu...@gmail.com) wrote:

> You can try admin method from trasportclient class.
> 
> > -----Original Message-----  
> > From: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> > [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] On Behalf Of sam  
> > Sent: 2011年8月26日 13:36  
> > To: elasticsearch  
> > Subject: How to get the cluster running status using java elastic API?
> 
> > Hi
> 
> > I want to check whether Elasticsearch server running or not and which  
> > state  
> > it give me information that server running nicely.
> 
> > Thanks

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 26, 2011, 2:21pm UTC](https://discuss.elastic.co/t/how-to-get-the-cluster-running-status-using-java-elastic-api/5255/4 "2011-08-26T14:21:40Z")

</div>

You first need to get a reference to a Client, for this type of operations,  
I suggest using the TransportClient. More info here:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html).

Once you have a client, check the Client#admin().cluster().prepareXXX  
operations, for example, health, node stats, node info.

2011/8/26 sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com)

> Thanks for your reply.but i'm not connect remotely to an elasticsearch  
> cluster.which class and method will help me to get for local servers  
> status. also any available document that help me to understand  
> elastic java library beside available java docs for that.
> 
> On Aug 26, 10:37 am, "Kun Niu" [haoniu...@gmail.com](mailto:haoniu...@gmail.com) wrote:
> 
> > You can try admin method from trasportclient class.
> > 
> > > -----Original Message-----  
> > > From: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> > > [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] On Behalf Of sam  
> > > Sent: 2011年8月26日 13:36  
> > > To: elasticsearch  
> > > Subject: How to get the cluster running status using java elastic API?
> > 
> > > Hi
> > 
> > > I want to check whether Elasticsearch server running or not and which  
> > > state  
> > > it give me information that server running nicely.
> > 
> > > Thanks

---

<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, 3:55am UTC](https://discuss.elastic.co/t/how-to-get-the-cluster-running-status-using-java-elastic-api/5255/5 "2017-07-06T03:55:57Z")

</div>


