Elasticsearch in Docker on Jenkins fails health check


I am using Elasticsearch and docker-compose inside a Jenkins pipeline to run my tests. Both Elasticsearch and the Node.js service seem to start properly from Docker, but performing a health check by hitting the http://elasticsearch:9200/_cat/health?h=st endpoint returns status code 000 from curl.

Running the tests and performing the health check from inside docker on local (macOS with Docker for Mac) working completely fine, but in Jenkins the health checks fail. Here is what my setup (with error log) looks like:

The entry point is run-tests.sh

Anypointers would be extraordinarily appreciated.

(Also posted on StackOverflow if you would prefer to chime in there: https://stackoverflow.com/questions/50369125/elasticsearch-in-docker-on-jenkins-fails-health-check


I was able to solve the connection issue by adding environment: ['transport.host='] to the elasticsearch service. See my comment in the gist: https://gist.github.com/austinkelleher/ae592eed024328bb738e3bef4dc0af4c#gistcomment-2591254

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.