Elasticsearch: healthcheck for embedded web application?

Hi,
I've got a webapp, deployed on elastic beanstalk, that has an embedded
instance of elasticsearch. I want to write a healthcheck servlet to test
connectivity. I know that I can use the builtin health api, but I'm
wondering if this is really the droid I'm looking for.

Ultimately, I think I want to test that my transport client (in the webapp)
can connect to a node, execute a search, and not get an exception (such as
NoNodeAvailable). Of course, my results shouldn't matter, or depend on the
state of the index.

am I over thinking this? if not, what would an appropriate query be,
matchAll() with a size of 1?

--paul

--

It depends on what you are looking for by "testing connectivity". Do you
want to manage a persistent connection (keep alive / heartbeat)? Or do you
want to check if the cluster is operational? Or degraded? Just let a REST
client or the TransportClient check for green cluster state. Executing
expensive queries is not required just for connectivity tests.

Jörg

On Friday, October 12, 2012 4:26:55 PM UTC+2, Paul Sanwald wrote:

Hi,
I've got a webapp, deployed on elastic beanstalk, that has an embedded
instance of elasticsearch. I want to write a healthcheck servlet to test
connectivity. I know that I can use the builtin health api, but I'm
wondering if this is really the droid I'm looking for.

Ultimately, I think I want to test that my transport client (in the
webapp) can connect to a node, execute a search, and not get an exception
(such as NoNodeAvailable). Of course, my results shouldn't matter, or
depend on the state of the index.

am I over thinking this? if not, what would an appropriate query be,
matchAll() with a size of 1?

--paul

--