Skip to content

Commit

Permalink
Fix healthcheck in ES compose service (elastic#20511)
Browse files Browse the repository at this point in the history
Python is not included anymore on Elasticsearch images, change the
healthcheck to be based on curl and the easier to parse cat API.

(cherry picked from commit 368d31b)
  • Loading branch information
jsoriano committed Aug 10, 2020
1 parent 255c992 commit 64fdda9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/libbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
file: ${ES_BEATS}/testing/environments/${TESTING_ENVIRONMENT}.yml
service: elasticsearch
healthcheck:
test: ["CMD-SHELL", 'python -c ''import urllib, json; response = urllib.urlopen("http://myelastic:changeme@localhost:9200/_cluster/health"); data = json.loads(response.read()); exit(1) if data["status"] != "green" else exit(0);''']
test: ["CMD-SHELL", "curl http://myelastic:changeme@localhost:9200/_cat/health?h=status | grep -q green"]
retries: 1200
interval: 5s
start_period: 60s
Expand Down

0 comments on commit 64fdda9

Please sign in to comment.