consul


Author: yifei / Created: Jan. 18, 2018, 3:11 p.m. / Modified: Jan. 18, 2018, 11:12 p.m. / Edit

Why not others?

https://www.gitbook.com/book/vincentmi/consul-guide

Client vs Server

Consul comes with 2 parts: client and server, The agents talk to one or more Consul servers. The Consul servers are where data is stored and replicated. The servers themselves elect a leader. While Consul can function with one server, 3 to 5 is recommended to avoid failure scenarios leading to data loss. A cluster of Consul servers is recommended for each datacenter.

These two DO articles are the best https://www.digitalocean.com/community/tutorials/an-introduction-to-using-consul-a-service-discovery-system-on-ubuntu-14-04

https://www.digitalocean.com/community/tutorials/how-to-configure-consul-in-a-production-environment-on-ubuntu-14-04

Consul agent config

Consul service/health check config

Consul template

Registrator

Normally you'll run a separate set of Consul servers (usually 3 or 5) and then run the Consul client agent on every other machine in your infrastructure. Applications always talk to the local Consul client agent, which will automatically forward requests to and keep track of the Consul servers. The Consul servers provide stable storage for the catalog, key/value store, and provide coordination for things like locks and semaphores. The Consul client agents on each other machine manage registering local services on that machine, and provide interfaces to Consul for applications on that machine (HTTP or DNS). There's usually no need to have redundancy at the Consul agent level on each machine, as that's part of the same failure domain as the machine itself.

from: https://github.com/hashicorp/consul/issues/1916


评论区