Cluster health vs indices health

We have an IOT project in an embedded system environment where we have limited linux box and resources, so we our application and elasticsearch on the same 3 machine cluster. Now it can happen the linux machines can bounce and when that happens we want to wait for elasticsearch to be up and running, the systemctl reports elasticsearch is up, the cluster health reports green, but
since the all indices are not yet green, our app crashes.

How is it that the cluster health report green using
http://localhost:9200/_cluster/health
while some of the indices below are still red
http://localhost:9200/_cat/indices?h=h

Is there a command to make sure elasticsearch is up and ready to use?
I assumed if cluster health reports green, then applications should safely be able to use elasticsearch, certainly thats not the case.

I don't think that can happen. If one of the indices is RED or YELLOW the cluster has then the same "color".

Could you share the output of each response?
And also the result of GET /?

You are right, this works, I had an issue with this and had switched if master was active
http://localhost:9200/_cluster/state/master_node,

Anyways the status works like you said.
Thanks for the quick response.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.