Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose not configuring #2

Closed
FlorianTolk opened this issue Apr 25, 2019 · 7 comments
Closed

docker-compose not configuring #2

FlorianTolk opened this issue Apr 25, 2019 · 7 comments

Comments

@FlorianTolk
Copy link

I have tried standing this repository up both on Ubuntu 16.04 and Ubuntu 18.04

After starting the docker swarm, the three couchdb instances start up in the network just fine. However, the cluster-setup service doesn't work and I need to configure it manually.

When looking at the console, it looks like docker-compose is trying to run the cluster setup before the actual couchDB containers are stood up.

@gesellix
Copy link
Owner

The tool should perform retries before actually trying to setup the cluster. See

fmt.Println(fmt.Sprintf("tick@%s", address))
for an expected log message. I'll have to investigate whether something is broken. If you have any logs to share, please leave them here (please beware not to share any credentials), they might help to understand the issue. Thanks!

@gesellix
Copy link
Owner

I changed the setup timeout in the docker-compose config to 60s. Can you please retry the current version?

@FlorianTolk
Copy link
Author

Setting the timer to a minute did solve the issue, thanks!
Looking at the logs, it seems like the cluster-setup runs it's code first. Below is a section of the output:

Creating couchdbclusterconfigmaster_cluster-setup_1 ... done
Creating couchdbclusterconfigmaster_couchdb1_1      ... done
Creating couchdbclusterconfigmaster_couchdb2_1      ... done
Creating couchdbclusterconfigmaster_couchdb3_1      ... done
Attaching to couchdbclusterconfigmaster_cluster-setup_1, couchdbclusterconfigmaster_couchdb1_1, couchdbclusterconfigmaster_couchdb2_1, couchdbclusterconfigmaster_couchdb3_1
cluster-setup_1  | Going to setup the following nodes as cluster
cluster-setup_1  | [172.16.238.11 172.16.238.12 172.16.238.13]
cluster-setup_1  | tick@172.16.238.12:5984
cluster-setup_1  | tick@172.16.238.13:5984
cluster-setup_1  | tick@172.16.238.11:5984
 <continue for 193 lines>
cluster-setup_1  | tick@172.16.238.11:5984
 <other services begin running>

For a more graceful solution, is there a way to delay the setup service starting until the other services have had a few seconds to start up?

@gesellix
Copy link
Owner

I could add an option like delay, but I'd like to set it to a small default value, because on some systems the services are available after a short time - or might even be running already -, so adding a another delay would add a constant amount of time before the cluster is configured.

Another option is to add another tool to the stack, which checks for the services' availability. See https://github.com/gesellix/couchdb-prometheus-exporter/blob/ef76f4757993cd16f963da16e74d5bcb6a3a1c70/examples/stack/docker-stack-single.yml#L18 for an example using a wait-for script.

I'll add the delay config option and get back to you soon so that you can give some feedback how big the delay on your system should to be.

@gesellix
Copy link
Owner

gesellix commented May 2, 2019

You can now define a custom setup delay (defaults to 5s). See bff4878 for an example in the repo's docker-compose.yml. With 20s the user experience on my Windows box was better, when the CouchDB container had to be created. For already existing CouchDB containers, 5s delay seemed to be a better value.

Please give it a try and leave some feedback here - I'm then going to tag a new release. From my perspective the issue has been resolved, but feel free to tell me in case I've missed something!

@gesellix gesellix closed this as completed May 2, 2019
@gesellix
Copy link
Owner

gesellix commented May 6, 2019

@FlorianTolk
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants