Consul is a distributed system for implementing service discovery and configuration of open source tools. He is mainly composed of multiple components:
-
Service Discovery: servicing clients through Consul, similar to the API, MySQL, or other client can use Consul discovery service providers. Use DNS or similar HTTP, applications, and can easily find their dependent services.
-
Health check: Consul client can provide services associated with a given health checks (Web server returns a 200 ok) or the local node ( "Memory utilization is less than 90%"). This information can monitor the operation of the cluster, and the host component access away from unhealthy.
-
Key-value pair storage: Applications can use hierarchical key Cousul the right.
-
Multi-data center: Consul there out of the box and with multiple data centers.
Consul role
client: The client, stateless, forwards HTTP and DNS interface requests to the server cluster within the LAN.
Server: server, save the configuration information, high availability clustering, in the LAN to communicate with local clients, and other data over the WAN communication Center the number of each data center server recommended as three or five.
agent
Each of the members of the consul must run on a cluster agent, you can consul agent
initiate commands. agent server can run state or the client state. Naturally, the server node running state is referred to as server nodes; client nodes running state is referred to as client nodes.
client node
Responsible for forwarding to all the RPC server node. Themselves stateless and lightweight, so it can deploy a large number of client nodes.
server node
Responsible for the composition of cluster complex work (elections, state maintenance, forwarding the request to the lead), as well as services provided by the consul (RCP response to the request). Considering the convergence and fault-tolerant, general deployment of three to five more appropriate.
Consul installation
Go to the official website to download: https://www.consul.io/downloads.html
Decompression
The directory D: / Consul added to the path environment variable, restart your computer
cmd in the implementation of the following interface to Consul agent -dev appear.
Enter localhost in the browser: 8500 to see the consul of ui interface