Consul introduction and consul Introduction
Consul contains many components in general. Consul is a service discovery and Configuration tool. Service Discovery: one client provides its own services, such as api services or mysql services, and the other client can discover the service providers through DNS or http. Health Check: Consul provides multiple health checks. Combined with service discovery. K/V Storage: dynamic configuration, consistency and coordination, leader election, and feature tagging. Consul's http api enables developers to use it better. Multi-Data Center: Consul creatively provides a multi-data center mechanism. This means that you do not have to create redundant virtual layers to apply multiple partitions. Consul Data Structure Consul is A distributed (P), high-availability system (). Each Consul Service provides a node and runs a Consul proxy. The Consul proxy does not mean that you must discover other services or perform corresponding data operations. The proxy only needs to be responsible for health check. The proxy connects to one or more Consul servers. The Consul server stores data, copies data, and selects leaader. Although the Consul server can run on a single instance, we recommend that you run three to five instance clusters in each data center to prevent data loss. Difference zookeeper: zookeeper provides temporary nodes for service discovery. when the service is disconnected, the temporary node is deleted. This service discovery mechanism is more sophisticated and complex than heartbeat detection, but it also has some inherent scalability problems and increases client complexity. All servers must maintain active connections with zookeeper. The service discovery mechanism of Consul is very different. Consul runs a client on every node of the cluster. These clients are part of the gossip pool (distributed health check, the gossip protocol is efficient in service downtime detection. No matter the number of services in the service cluster, Consul can perform a health check by simply returning the 200 status of the service.