# How to check the elasticsearch is available

**URL:** <https://discuss.elastic.co/t/how-to-check-the-elasticsearch-is-available/20371>\
**Category:** Elasticsearch\
**Created:** [October 22, 2014, 2:33am UTC](https://discuss.elastic.co/t/how-to-check-the-elasticsearch-is-available/20371 "2014-10-22T02:33:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weiguo\_Xia](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@Weiguo\_Xia](https://discuss.elastic.co/u/Weiguo_Xia)\
**Post date:** [October 22, 2014, 2:33am UTC](https://discuss.elastic.co/t/how-to-check-the-elasticsearch-is-available/20371/1 "2014-10-22T02:33:14Z")

</div>

Hi,  
I am new to elasticsearch, I meet a some problem.

I write a code that need the elasticsearch is ready to use. In my code,  
I run the elasticsearch first. But it need some time that elasticsearch is  
ready.

How can I tell when the elasticsearch is ready?

Thank you.  
WX

--  
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/7a24d6d0-5186-4e04-a471-9a4718ef46f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7a24d6d0-5186-4e04-a471-9a4718ef46f7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 22, 2014, 6:21am UTC](https://discuss.elastic.co/t/how-to-check-the-elasticsearch-is-available/20371/2 "2014-10-22T06:21:52Z")

</div>

If you are doing Java, you can do:

node.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

> Le 22 oct. 2014 à 04:33, Weiguo Xia [xiaw61@gmail.com](mailto:xiaw61@gmail.com) a écrit :
> 
> Hi,  
> I am new to elasticsearch, I meet a some problem.
> 
> I write a code that need the elasticsearch is ready to use. In my code, I run the elasticsearch first. But it need some time that elasticsearch is ready.
> 
> How can I tell when the elasticsearch is ready?
> 
> ## Thank you. WX
> 
> 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/7a24d6d0-5186-4e04-a471-9a4718ef46f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7a24d6d0-5186-4e04-a471-9a4718ef46f7%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/E992B67D-D9E5-45D4-BAF6-4EBC0DE7B03B%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/E992B67D-D9E5-45D4-BAF6-4EBC0DE7B03B%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:54am UTC](https://discuss.elastic.co/t/how-to-check-the-elasticsearch-is-available/20371/3 "2017-07-06T00:54:30Z")

</div>


