-
Notifications
You must be signed in to change notification settings - Fork 11
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
[emerg] 1#1: host not found in upstream #8
Comments
To work in docker swarm as load balancer it also must remove ip addresses from the upstream, if dns request returns nothing. |
DNS resolving begins on worker process start phase. |
Resolve is performed here https://github.com/nginx/nginx/blob/master/src/http/ngx_http_upstream.c#L5982. |
We can't use standard server directive if we want to skip not resolvable hosts. We need to create own directive (similar to server) to add servers into upstream, which will skip not resolvable hosts. |
Thank @ZigzagAK and got it, so do you think that our healthcheck module will compatible with this https://github.com/nicholaschiasson/ngx_upstream_jdomain or not? |
Dear, is it possible to override just the resolver to response 0.0.0.0:1 on that case? Seem like this module is doing that? https://github.com/GUI/nginx-upstream-dynamic-servers |
@huaphuoctruong |
@zdm , yes we can, but we must implement our directive, as i wrote before. |
I understand, this is complex. |
Thank @ZigzagAK. Btw, I have to do a workaround solution. I made a simple patch here. I see that these codes have been there for over 7 years already so this patch would work with many nginx version (I hope so and testing now).
|
Yes, it is should work, but i don't like to patch nginx core. Separate directive is more attractive. |
@zdm |
ok, thank you very much |
You may try https://github.com/ZigzagAK/ngx_http_upsync_upstream. This module has one limitation - chunked response is not supported. You must use http 1.0 or responses with content-length. Chunked response parse may be ported from ngx_dynamic_healthcheck but now it is not required for me. |
i'll take a look, thanks |
Currently Nginx will immediately exit if the server in upstream directive is not resolvable. I think it should be by passed so that we can start the nginx independently from other services. In Docker Swarm the nginx service may be started faster than others or any bug in the others service will cause service domain to be unresolvable.
The text was updated successfully, but these errors were encountered: