Skip to content

Commit

Permalink
[elasticsearch] Tweak the 'readinessProbe' command to verify that master
Browse files Browse the repository at this point in the history
nodes are available.

The behaviour of the `/` endpoint changed[0] between 6.x and 7.x, whereby
previously it would return a HTTP `503` response when the cluster was
blocked, it now returns a HTTP `200` response even if there are no masters
available.

This change updates the behaviour of the `readinessProbe` command during
normal running to verify that the local node is responding and that there
are master nodes available. [1]

The desired behaviour here is that if the data nodes are unable to talk to
their master nodes for whatever reason, then the data nodes will become
`Unready` and therefore be removed from the Service load-balancer until
the master nodes are available again.

Refs:
[0] elastic/elasticsearch#29045
[1] elastic/elasticsearch#34897 (comment)
  • Loading branch information
Gavin Williams committed Nov 20, 2019
1 parent db3c1a0 commit dd8c9e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ spec:
}
if [ -f "${START_FILE}" ]; then
echo 'Elasticsearch is already running, lets check the node is healthy'
http "/"
echo 'Elasticsearch is already running, lets check the node is healthy and there are master nodes available'
http "/_cluster/health?timeout=0s"
else
echo 'Waiting for elasticsearch cluster to become cluster to be ready (request params: "{{ .Values.clusterHealthCheckParams }}" )'
if http "/_cluster/health?{{ .Values.clusterHealthCheckParams }}" ; then
Expand Down

0 comments on commit dd8c9e8

Please sign in to comment.