How to auto deregister a service?

1,186 views
Skip to first unread message

Ha Truong

unread,
Jul 3, 2015, 8:52:58 PM7/3/15
to consu...@googlegroups.com
I have a service registered to Consul. When I turn it off, how can I auto deregister? Is it a config when register?

Nicholas Capo

unread,
Jul 3, 2015, 9:07:18 PM7/3/15
to consu...@googlegroups.com

You could use the http api [1] to deregister it, but probably only if you used the api to do the registration too, instead of the config file.

Nicholas

[1] https://www.consul.io/docs/agent/http/agent.html#agent_service_register


On Fri, Jul 3, 2015, 19:53 Ha Truong <truong...@gmail.com> wrote:
I have a service registered to Consul. When I turn it off, how can I auto deregister? Is it a config when register?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/fa0bd0a0-5079-4108-884b-fb33fbae8af9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shawn Cook

unread,
Jul 7, 2015, 7:17:59 AM7/7/15
to consu...@googlegroups.com
Isn't that what a health check does?  Maybe I'm being naïve.  I'm going to need to figure this out soon too.  Will try to remember to post an update once I get there.

Ryan Uber

unread,
Jul 7, 2015, 12:13:01 PM7/7/15
to consu...@googlegroups.com
Health checks and service registrations are independent of each other in Consul. They work closely together, but it is not strictly necessary that you deregister a service if the node(s) providing the service go offline. Queries via the DNS or HTTP health API's will not return the unhealthy node when querying for the service. If you want to completely deregister the service, then you can do so by removing the service from the config, or using the HTTP API if you registered the service that way.

Hope that helps!

-- 
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
--- 
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages