Giter VIP home page Giter VIP logo

Comments (4)

toughIQ avatar toughIQ commented on July 26, 2024

Hi @yaakov-berkovitch,
I have an idea, but it has nothing to do with the healtcheck.
I was playing around and found that compose version 3 does not work with swarm mode. So at least I saw this message after docker-compose up:

WARNING: Some services (mariadb) use the 'deploy' key, which will be ignored. Compose does not support deploy configuration - use `docker stack deploy` to deploy to a swarm.

This mariadb-cluster image was especially designed to work with swarm mode. When doing the init_cluster stuff it tries to get the IPs of the other nodes. getent hosts tasks.$DB_SERVICE_NAME

This check does not return anything or when doing it here

CLUSTER_MEMBERS=`getent hosts tasks.$DB_SERVICE_NAME|awk '{print $1}'|tr '\n' ','`

it fails with exit code 2

Why does it work sometime and sometimes not?
Simple. Since you are working with docker-compose there is a containername created at each startup. This name consists of currentDirectory_ServiceName_NumberCurrentReplica. For the same service within a compose file this name does not change.
At the first initial start the container fails and exits. But the container still exists. The next docker-compose up does not initialize a brand new container, but starts the previous one, since the name according to the naming schema of compose is identical.
But this time the original docker-entrypoint.sh script from MariaDB finds an already installed database, since there already is a data directory present in the container. If this is the case the init scripts within /docker-entrypoint-initdb.d/* don't get executed and hence it cannot fail with this exit 2 error.

from docker-mariadb-cluster.

yaakov-berkovitch avatar yaakov-berkovitch commented on July 26, 2024

Thanks your answer.
I was probably not clear but I'm using the compose file together with the docker deploy --compose-file.
So the deployment is made in the swarm mode.
Also the exit code I got during deployment is also 2 and the issue is perhaps also related to getent.
But I cannot figure why the healthcheck instruction interfere with the launching of the container.

from docker-mariadb-cluster.

4n70w4 avatar 4n70w4 commented on July 26, 2024

Same problem. I would like to make a health check that the server is running and fully replicated and ready to accept new requests.

from docker-mariadb-cluster.

4n70w4 avatar 4n70w4 commented on July 26, 2024

Workaround:

Use https://github.com/colinmollenhour/mariadb-galera-swarm with included work healtcheck.

from docker-mariadb-cluster.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.