-
Notifications
You must be signed in to change notification settings - Fork 122
/healthcheck endpoint should check for Elasticsearch availability #487
Comments
Hi Alden, this looks interesting, I'd love to work on it. |
Hi Alden in order to check the health of the
However, I keep getting a 404. Is there something I'm doing wrong? |
Figured this, didn't know elastic search was running on a seperate host/port :) |
That's great! It would be best to use the equivalent |
Alright...would look at the suggestion.
…On Fri, May 8, 2020, 21:06 Alden S Page ***@***.***> wrote:
It would be best to use the equivalent elasticsearch-py query instead of
making direct calls to the REST API. Here's
<https://discuss.elastic.co/t/how-to-get-cluster-health-using-python-api/25431>
an example for getting the cluster health; there ought to also be a way to
narrow the query to the image index.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#487 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGFLMYA5WLAQPO5GYZNX5BTRQRQ5RANCNFSM4M2V5EKA>
.
|
This comment has been minimized.
This comment has been minimized.
Update:I've successfully managed to query the health of the entire cluster, using the Elasticsearch connection instance gotten from It'd be nice to point out that as at the time of writing, I'm yet to successfully run |
Hi Alden, Progress Report :) Successfully got the However, I figured out the reason for the unresponsiveness when querying the elastic search Do I need to do a manual population or something? |
Hi again Onyenanu – if the index doesn't exist, the healthcheck should fail. This could happen in situations where we are switching Elasticsearch clusters in production and forgot to index data into the new one (or something went wrong while we were loading data into the new cluster). In my experience, the ES Python libs can behave in unexpected ways that you sometimes have to work around. Since it seems like querying specifically for the It sounds like it's coming along nicely! |
Hey Alden...Many thanks again for coming through with better insights. Suggestion sounds nice, would proceed with it. And yes, the whole stuff is getting more interesting, learnt a handful in the few days :) |
During deployments, our load balancer repeatedly polls the
/healthcheck
endpoint to check that the server is reachable. If this check succeeds, the newly deployed instance starts receiving production traffic. Right now, if Elasticsearch is not responsive,/healthcheck
will still return200 OK
.The healthcheck endpoint should check the health of the
image
index in Elasticsearch using the cluster health API. If it is unavailable, return error 500. Log an informative message explaining why the healthcheck failed.Because the healthcheck endpoint may be called many times, and Elasticsearch calls are not free, we should cache the response of Elasticsearch for up to 10 seconds per call.
The text was updated successfully, but these errors were encountered: