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

Support DNS lookups to "meta" DCs #208

Closed
armon opened this issue Jun 12, 2014 · 25 comments
Closed

Support DNS lookups to "meta" DCs #208

armon opened this issue Jun 12, 2014 · 25 comments
Labels
type/enhancement Proposed improvement or new feature

Comments

@armon
Copy link
Member

armon commented Jun 12, 2014

We can support special meta-dc's that have special meanings. Examples:

  • 'global' - Do a lookup across all DCs
  • 'any' - Returns results from first DC to respond
@progrium
Copy link

progrium commented Jul 2, 2014

  • 'local' - do a lookup for only services on that agent (special meta DC)

@wuub
Copy link
Contributor

wuub commented Jul 11, 2014

@armon this is very interesting. are there any active work/design going on, or is it only an idea?

@armon
Copy link
Member Author

armon commented Jul 11, 2014

@wuub No active work on this yet, but its in the design phase you could say. Definitely something I'm keen to support!

@armon
Copy link
Member Author

armon commented Jul 16, 2014

@andrewwatson mentioned the possibility of named groups of data centers. e.g. "EU" -> ["UK", "GE", "FR"]

@andrewwatson
Copy link
Contributor

In addition to establishing maps like "EU" -> ["UK", "DE"] it would be very useful to be able to specify for each dc a backup or a list of backups

I'm thinking this could be in the K/V, even.

/_meta/dc/backups => 'dc1, dc2, dc3'

That way you could change it without restarting anything.

@jefferai
Copy link
Member

Yes, yes, a thousand times yes.

We want to have the ability, when desired, to have services resolve locally when possible but remotely if necessary. We don't necessarily want every query to behave this way so it'd be nice to be able to specify behavior per-query.

I'm assuming the "global" behavior mentioned in the first comment would be what I described above.

@armon armon added the type/enhancement Proposed improvement or new feature label Oct 14, 2014
@keyneston
Copy link

If and when you do implement this can you make sure these meta-datacenters also work in the http api.

It would be useful in our puppet code for example to be able to say dc=global.

@mfischer-zd
Copy link
Contributor

+1 for this request. We would like a datacenter-neutral, globally replicated K/V store, where the HTTP clients (not necessarily through their own Consul agent) preferentially look up from the local datacenter but can fall back over the WAN if necessary.

@armon
Copy link
Member Author

armon commented Oct 27, 2014

@mfischer-zd As a note, this ticket will only affect DNS and not the KV store

@mfischer-zd
Copy link
Contributor

@armon understood - this would affect how the Consul HTTP server (which would be accessible remotely) would be resolved.

@andrewwatson
Copy link
Contributor

No, I don't think so. It would affect the answers you got back from the
consul server you send DNS queries to.

On Mon, Oct 27, 2014, 1:19 PM Michael S. Fischer [email protected]
wrote:

@armon https://github.com/armon understood - this would affect how the
Consul HTTP server (which would be accessible remotely) would be resolved.


Reply to this email directly or view it on GitHub
#208 (comment).

@mfischer-zd
Copy link
Contributor

@andrewwatson in my scenario I have two separate Consul clusters, one configured in the usual way (cluster A), and another that provides a replicated K/V store (cluster B, running on a dedicated set of hosts which does not include the clients). Cluster A would be used by clients to perform DNS queries to resolve members of Cluster B.

So really we're saying the same thing.

@hco
Copy link

hco commented Nov 10, 2014

+1 For this feature! :-)

A nice to have would be to allow your own priorities for a response of the DC "any".

@adrienbrault
Copy link

👍

@hopperd
Copy link

hopperd commented Apr 7, 2015

+1
This functionality would be very useful, we have multiple data centers and a client might not actually know which datacenter that service resides in and thus would want to have local return if available, but then the others if not.

@mfischer-zd
Copy link
Contributor

An easy workaround would be to use a regular DNS server to serve a CNAME record outside the .service.consul domain. For example, a query for "frobinator.service.local" against the local DNS resolver could result in a CNAME answer for "frobinator.dc1.service.consul".

What do you think of this? Doing so would keep Consul out of the complex business of managing foreign service endpoints.

@jefferai
Copy link
Member

jefferai commented Apr 8, 2015

@mfischer-zd then you have to implement and configure some other piece of software to do this, when Consul already knows where things live.

@armon armon mentioned this issue Jun 17, 2015
@DanyC97
Copy link

DanyC97 commented Jun 30, 2015

Has been done any progress on this ?

thanks!

@StephenTallamy
Copy link

Any updates on this? Is a solution likely to hit a release version soon? I have this same requirement - I want my DNS names to resolve to nodes in my local data center unless Consul detects an outage for all nodes in my local data center and then it will resolve to nodes in a remote data center. At this point I don't need rules around which data center it fails over to, although later this could be beneficial.

@armon
Copy link
Member Author

armon commented Jul 22, 2015

We are getting closer, but still looking like a Consul 0.6 or 0.7 feature.

@StephenTallamy
Copy link

Thanks @armon - what's the release timescale on those?

@armon
Copy link
Member Author

armon commented Jul 23, 2015

@StephenTallamy No hard deadlines. Consul 0.6 likely next month, and 0.7 in Q4.

@hopperd
Copy link

hopperd commented Aug 4, 2015

Will this functionality help with DNS forwarding? Currently it seems as though it isn't possible to use DNS forwarding with multiple data centers as you'll only get back the services from the DC that is queried. We have currently 2 data centers (these are real data centers in different parts of the country) and multiple environments in each data center (dev, qa, perf, prod, etc).

So it seems that setting up DNS forward to work in this situation is essentially not possible without this feature.

@armon
Copy link
Member Author

armon commented Aug 5, 2015

@Split3 Correct! You will be able to query multiple DCs at the same time.

@slackpad
Copy link
Contributor

slackpad commented Jan 9, 2016

The "local" use case is covered here #1229 and in its linked issues. The multi-DC aspect of this is now supported with prepared queries, released in 0.6.0:

https://www.consul.io/docs/agent/http/query.html

@slackpad slackpad closed this as completed Jan 9, 2016
duckhan pushed a commit to duckhan/consul that referenced this issue Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Proposed improvement or new feature
Projects
None yet
Development

No branches or pull requests