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

Proposal: Create a Way to Find Local Service with DNS Discovery #1229

Closed
ekristen opened this issue Sep 10, 2015 · 2 comments
Closed

Proposal: Create a Way to Find Local Service with DNS Discovery #1229

ekristen opened this issue Sep 10, 2015 · 2 comments

Comments

@ekristen
Copy link

In some deployment models like with nsq it is recommended that you run a nsq instance per server and all applications on that server talk to that nsq instance.

As it stands today I either have to pass the node name or manually specify the port and host to connect to for all apps on the server.

My proposal is that the service tag local is introduced as a reserved tag that when seen by the agent means it looks only locally for that service and returns the appropriate DNS.

Example:

  • local.nsqd.service.consul on server01 will return 10.10.100.100
  • local.nsqd.service.consul on server02 will return 10.10.100.200
  • nsqd.service.consul on server01 will return 10.10.100.100, 10.10.100.200
  • nsqd.service.consul on server02 will return 10.10.100.100, 10.10.100.200

To elaborate a little further, the local tag should work like normal, only return DNS record if the service exists on the local agent, and is in a healthy state.

Bottom Line: local would be a special tag that when used would make the agent not consult the entirety of the datacenter and only resolve local services to local agent.

@highlyunavailable
Copy link
Contributor

This is sort of an inverse duplicate of #488 that I asked for a long time ago and sort of related to #252 I think.

@slackpad
Copy link
Contributor

slackpad commented Jul 1, 2016

#2137 will let you do this using a simple prepared query definition (and with prepared query templates you can create a single template definition that'll cover all your services).

@slackpad slackpad closed this as completed Jul 1, 2016
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

3 participants