Consul service de-registration only works if . . .

909 views
Skip to first unread message

Arash Sami

unread,
Jul 6, 2017, 3:04:15 PM7/6/17
to Consul
Consul service de-registration only works if the api call sent to the same node ? to clarify here what we observed.

Service registration to node-01 (/v1/agent/service/register)
Service de-registration does't work if we de-register it from node-02 (via rest api - /v1/catalog/deregister
Service de-registration works only if we de-register it from the same node node-01 (/v1/catalog/deregister)

is this intended, is it suppose to be like this ?

Thanks

Thomas

unread,
Jul 7, 2017, 8:12:20 AM7/7/17
to Consul

Hi.

I am no consul developer, but I think that’s intended, because the service definition is stored locally on the node (/consul/cluster/services/) and thus an agent information. A service in the consul infrastructure catalog lives so long a node holds the service locally.  

 

Because we talking about /v1/agent/service/register ... can you say prove my issue?:

https://github.com/hashicorp/consul/issues/3227

Arash Sami

unread,
Jul 7, 2017, 9:21:52 AM7/7/17
to Consul
Thanks for your response, How do you maintain the HA then, let's say my service is on node-01 and an app is pointing to node-01 - then what we'll happen is node-01 is not available to any reason ?

Nicholas Capo

unread,
Jul 7, 2017, 9:31:16 AM7/7/17
to Consul

If you are trying to do HA then you should be running more than one instance of the service on more than one node and load balancing/failover between them.

Then if node-01 goes down the load balancer won't send it requests.

This feature of consul is actually pretty nice since if your node goes down, your service will be automatically marked as unhealthy. If it worked another way, your node might go down without taking the service registration with it.

In other words, since your service is really running on that node, if the node crashes, so does the service. They are in the same failure domain.

Nicholas


--
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/89cb64b7-1f14-4a29-a310-888a15f85226%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nick Wales

unread,
Jul 7, 2017, 9:58:57 AM7/7/17
to Consul
Ideally you would be deregistering from the agent the service is running on, via the /v1/agent/service/deregister endpoint. https://www.consul.io/api/agent/service.html#deregister-service

If you are using the catalog to deregister, the requirement is to include the host in the payload, which allows me to deregister from any node. https://www.consul.io/api/catalog.html#deregister-entity

Arash Sami

unread,
Jul 7, 2017, 10:31:36 AM7/7/17
to Consul
Thanks Nick - I think this what I wanted to know - We've been a bit confused on how to de-register without going to an specific node.
Reply all
Reply to author
Forward
0 new messages