Comments (4)
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.
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.
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.
Workaround:
Use https://github.com/colinmollenhour/mariadb-galera-swarm with included work healtcheck.
from docker-mariadb-cluster.
Related Issues (13)
- MariaDB crashes on multi-node cluster HOT 3
- Using in production. HOT 2
- When reboot master db node then can not join back to the old cluster HOT 1
- This is not mariadb detected
- Upgrade to mariaDB10.4 HOT 3
- Node not detected on maxscale
- Persistence HOT 10
- Pulse check HOT 2
- Thanks
- can't use mode global HOT 3
- a node issue could cause to be locked out from the cluster HOT 3
- Service fails on startup HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-mariadb-cluster.