1. To maintain the robustness of this central agent, I would like to run this agent in HA mode(1 active+1 standby). Does the consul provide any mechanism with which I can failover to the backup node seamlessly, if the active node fails?
But I observed "services watch command" provides us with only the list of services presently active in this cluster. So, to effectively identify services that have just been registered/deregistered, I would have to first identify the service that has been registered/deregistered and query again with the service name to get the detailed info.I sincerely think there should be a better way to do this. So my next question is, how can I monitor the services registering/deregistering in an optimal way possible?
Is there a reason the agent needs to run in active+standby mode? Can you instead run multiple active instances of the agent and load balance traffic between them?If so, you can run an arbitrary number of copies of the agent on different nodes, register them all in consul with a health check, then access them via consul's DNS API [0].
I'd like to jump in here because this hits on a use case I'd really like to see Consul support. Cosmo is correct that Consul doesn't support a nice active-passive failover case at the moment, but there's no reason it couldn't. Right now DNS results for a particular service or query are returned in random order. That's great for a fully round-robin service, but it's not so great for other scenarios. For example, we've got a service where we'd like to do a soft active-passive model, wherein we have identical database proxies running for each of our database servers in each AWS availability zone in which our application operates. Any database proxy can talk to any database server, but in the optimal case when everything is running, we prefer each group of app servers in one AZ to talk to its database server via its default proxies. But when a proxy server fails, we'd like the DNS to route traffic to the nearest (network topology-wise) working proxy. But the current model for stored queries (as far as I understand it) is not robust enough for ordering by network proximity, nor for returning a limited number of results, nor for using service tags for priority. I've poked around at the Go code for this stuff a little bit, but it's a bit beyond my ability or spare time as yet.
Sorry for taking a tangent there. I suppose I should file a feature request for this, eh?
Does the (relatively new) prepared query templates feature achieve what you want via either DNS or API??
--
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/56a1de84-998c-4ba4-ae89-d3aef83d4852%40googlegroups.com.
I'd also like to be able to prioritize on other factors as well. [...] I am going to try to put some time into a PR or two that will add the features I'm looking for, because some of it seems relatively straightforward.