Consul is an open source tool launched by HashiCorp, which is used to realize service discovery and configuration of distributed systems. Compared with other distributed service registration and discovery solutions, Consul's solution is more "one-stop", with built-in service registration and discovery framework, distributed consensus protocol implementation, health check, Key/Value storage, and multi-data center solutions. Need to rely on other tools (such as ZooKeeper, etc.). It is also simpler to use. Consul is implemented in Golang, so it is naturally portable (supports Linux, Windows and Mac OS X); the installation package contains only one executable file, which is convenient for deployment and works seamlessly with lightweight containers such as Docker.
Consult use scenarios
- Docker instance registration and configuration sharing
- Registration and configuration sharing of coreos instances
- vitess cluster
- Configuration sharing for SaaS applications
- Integrate with confd service to dynamically generate nginx and haproxy configuration files
Advantages of Consul
- Using the Raft algorithm to ensure consistency is more straightforward than the complex Paxos algorithm. In comparison, zookeeper uses Paxos, while etcd uses Raft.
- Supports multiple data centers, and the services of the internal and external networks are monitored on different ports. A multi-data center cluster can avoid the single point of failure of a single data center, and its deployment needs to consider network delay, fragmentation, etc. Neither zookeeper nor etcd provide support for multi-data center functions.
- Support for health checks. etcd does not provide this feature.
- Support http and dns protocol interface. The integration of zookeeper is more complicated, etcd only supports http protocol.
- The official web management interface is provided, etcd does not have this function.
Comprehensive comparison, Consul, as a new star in service registration and configuration management, is worthy of attention and research.
The role of Consul
client: client, stateless, forwards HTTP and DNS interface requests to the server cluster in the local area network.
server: server, saves configuration information, high availability cluster, communicates with local clients in the local area network, and other data through the WAN Central communication. The number of servers in each data center is recommended to be 3 or 5.
.NET client https://github.com/PlayFab/consuldotnet/ , Nuget https://www.nuget.org/packages/Consul/
For specific articles, refer to https://playfab.com/blog/2015/05/19/porting-consul-go-api-c
Docker image with mono-complete and consul-agent: https://github.com/catwithboots/monoconsul
Service registration discovery using Apache Mesos and Consul
Automating the Modern Data Center with Terraform and Consul
Distributed service registration and discovery using consul
Consul environment build and test
Docker load balancing and service discovery
http://www.cnblogs.com/shanyou/p/4695131.html