xp
xp copied to clipboard
Add healthcheck endpoint to XP
This is a feature request to add a health check endpoint to XP. This necessity originates from the operator but we can just as well try to accommodate for non-k8s use cases.
The operator has up to this point relied on the built in ES healthcheck: <host>:9200/_cluster/health?wait_for_status=green&timeout=1s
. This has worked OK so far but it has its drawbacks. For example, If XP cannot write the blobstore, the startup will fail but ES will report that everything is OK.
We need an endpoint that will:
- Have a similar query parameter of specifying an acceptable ES state (
green
oryellow
). - Give a 200 OK when "XP is ready".
The first point is pretty trivial and we need that to do automatic rolling updates. We need to be able to specify that a data node is not ready until the ES cluster is green. This is not as important for pure frontend nodes, and they can be ready when ES is yellow.
The second point is a bit more complicated. The question is, when do we deem XP ready? This is up for debate but the conditions could include:
- ElasticSearch is up
- Hazelcast is up (in clustered setting)
- XP started listening on 8080
- ...
Aren't you describing the "alive app" here?
@sigdestad No I am not. That app does not allow for that yellow/green functionality at the moment.
Also, I am of the opinion that this is a core feature that should be in XP, not in an app. Preinstalling a bunch of apps to get XP to run properly on K8s is not the way to go.
Relevant discussion: https://github.com/enonic/xp-operator/issues/65
work continues in #10094 and #10096
easticsearch yellow/green status is for the entire cluster and cannot tell if XP node is alive/healthy. We decided to go the other direction (see above)