-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Querying DNS SRV record returns wrong host #1125
Comments
This looks like a subtle bug in the DNS system. Since we don't have any node for that service address, we can't formulate a proper SRV record response (from what I understand, the target must be a name, and not an address directly). There currently is no way around this while using the DNS interface, so unfortunately for now you would need to either use well-known port numbers or the HTTP API to grab the correct info. I'll mark this as a thinking ticket, since I'm not sure off hand what the best solution to this would be. |
we need this :) Also, in this world of ephemeral containers, making a container a consul node, will make the serf network suffer, difficulting the work of the consistency process. We've already seen false positives and negatives of services running this way. Given that the deregistration of a service takes 72hrs. automatically, and that in our typical dev environment, there are dozens of re-deployments per day, we end with a consul full of ghost nodes. We believe that using consul in this scenario requires using service abstraction to represent those services in containers, with their IPs, etc. and using the container's host as a consul node, which participate in the serf network. We think consul development is going this way, that's why we choose it instead of implementing our own tool. Said that, we'd love to see the DNS api to support having services as nodes. One option could be using services as nodes, separating serf nodes from service nodes in the consul internals. We don't have any PR yet, but we would like to hear your opinion about it. thanks |
I'll take a look into this post HashiConf. |
fyi, we're working on a solution that on container termination issues a consul leave, we'll update this when the tests is done. |
Hmm, commit 2a26597 may have fixed this already. Is there a released Consul version containing this fix? |
@mfischer-zd that went out in 0.7.1, but had an issue we just fixed in 0.7.4 that released today (#2695). I think you might be right that this is a dup of #1228 (at least solution-wise). |
I'm a coworker of @mfischer-zd. I downloaded Consul 0.7.4 and tried to reproduce the problem. I registered a service like:
and then did a SRV lookup. As desired, the SRV lookup returned a record that resolved to the service IP, rather than the Node IP.
So as far as I can tell, this issue is fixed in 0.7.4. |
@jonmoter thanks for the confirmation! |
We try to register a service on a remote consul node. So the service itself and the consul process are running on different hosts (docker containers).
f3632a6214bc
with IP172.17.0.96
.bda62c8a3961
(with aliasconsul
) with IP172.17.0.95
.We provide the address of the service in the
ServiceAddress
field.Here you can see the data stored for the service:
Querying the A record for the service returns the correct IP address:
But querying the SRV record returns the wrong host name
bda62c8a3961
.Is there any other way to get the correct host and port of the service by using DNS?
The text was updated successfully, but these errors were encountered: