Difference between `Agent.ServiceRegister` and `Catalog.Register`

1,110 views
Skip to first unread message

Alexander Lücking

unread,
Mar 6, 2016, 3:18:13 PM3/6/16
to Consul
Hi,

I'm digging through the consul go api and found to ways to register a new Service:

Are there explicit differences between those two ways?

James Phillips

unread,
Mar 10, 2016, 9:46:41 PM3/10/16
to consu...@googlegroups.com
Hi Alexander,

Typically, you use the Agent API to add services and register them with the Consul agent running on the node providing the service. The agent will automatically use the Catalog API to sync what has been registered with the Consul servers. In Consul, the source of truth about service registrations is out at the edges with all of the agents and they make sure the catalog is up-to-date. This adds a layer of robustness if you had to rebuild your Consul servers.

You'd only register with the Catalog API directly if you were not use a Consul agent for some reason, which isn't common or recommended. Hope that helps!

-- James

--
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/4223b850-1638-4fdb-87df-dc68a331f63b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages