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.
  • Loading branch information
jsoriano authored Aug 10, 2020
1 parent 9ab9b97 commit 368d31b
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 368d31b

Please sign in to comment.