Skip to content

Commit

Permalink
Change healthcheck for mysql images (elastic#10755) (elastic#11444)
Browse files Browse the repository at this point in the history
Use host and port to ensure that network connection is used and not
local socket.

Use `SHOW STATUS` that is the query used by the metricset.

(cherry picked from commit 6c6df1b)
  • Loading branch information
jsoriano committed Mar 26, 2019
1 parent 53b8c27 commit 1cb8f0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metricbeat/module/mysql/_meta/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM $MYSQL_IMAGE

ENV MYSQL_ROOT_PASSWORD test

HEALTHCHECK --interval=1s --retries=90 CMD mysql -u root -p$MYSQL_ROOT_PASSWORD -P 3306 -e "SELECT 1"
HEALTHCHECK --interval=1s --retries=90 CMD mysql -u root -p$MYSQL_ROOT_PASSWORD -h$HOSTNAME -P 3306 -e "SHOW STATUS" > /dev/null

COPY test.cnf /etc/mysql/conf.d/test.cnf

0 comments on commit 1cb8f0c

Please sign in to comment.