-
Notifications
You must be signed in to change notification settings - Fork 33
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
dnsrr discovery method does not work when "healthcheck" used #47
Comments
Looks like others have encountered this problem as well: |
I haven't yet tried the |
That method uses the actual swarm APIs to discover peers, so its not reliant on the auto-generated swarm peer level host/dns like |
btw @mnoky, on that moby issue, I highly doubt that issue will ever be resolved. They've seemingly abandoned swarm to minimal maintenance mode at this point. |
Hi @bitsofinfo @mnoky, I've found a workaround for that in my scenario (not necessarily covers all) and I hope could help someone. Little notice about swarm: To overcome the initialization problem in my springboot (jhipster) microservice using your awesome hazelcast-docker-swarm solution, I've set this in my docker-compose: healthcheck:
test: (echo 'exit' | curl -v telnet://localhost:8082 2>&1 | grep -c refused > /dev/null) || (curl -sS http://localhost:8082/management/health | grep -c UP > /dev/null)
interval: 5s
timeout: 30s
retries: 4
start_period: 3s #must be less than JHIPSTER_SLEEP The rational behind this is that application needs to resolve docker service name during startup but swarm healthcheck does not allow it until healthcheck itself is ok. So we first allow healthcheck to be initially ok if local service port (8082) is refusing connection (application is starting) but as soon as local port is responding, healthcheck with test the real application check output. |
Great project, I'm excited to get this working for a service I have deployed in a docker cluster! Currently testing 1.0-RC14 and I've hit the following snag:
The dnsrr discovery method does not work when a docker "healthcheck" is used. Reason being: during startup, the service name cannot be resolved. The name is not available until after the healthcheck succeeds and the service is up and running. Thus, it is a bit of a chicken-and-egg problem. The following exception is thrown at startup and the service cannot start (only relevant lines shown)
When I disable the healthcheck for my service, the dns resolution works right away and there are no problems.
Is it possible to delay the dns lookup in DockerDNSRRMemberAddressProvider? Or does it need to be available right away?
The text was updated successfully, but these errors were encountered: