Consul is an open source tool from HashiCorp for service discovery and configuration in distributed systems. Consul is distributed, highly available, and scaleable.

1. Install Consul

Prepare the installation file. The following uses CentOS as an example.

  1. Enter the consul’s official website to find their development platform corresponding installation package download www.consul.io/downloads.h… Wget or https://releases.hashicorp.com/consul/1.9.0/consul_1.9.0_linux_amd64.zip

  2. Once downloaded, unzip and you get an executable file consul

  3. Move this file into the global variable environment

      $ sudo mv consul /usr/local/bin/
    Copy the code
  4. Verify that the installation is successful

      $ consul
    Copy the code

2. Terminology description of Consul

  • Client: a stateless client that forwards node data but does not store node data. It forwards HTTP and DNS interface requests to the Server cluster in the LAN, which is responsible for identifying the failure of the Server node and finding a healthy Server node for work. If there is no client, multiple microservices may be registered to a Server node. If the Server node fails, the registered services are regarded as failed services.
  • Server: a server that stores configuration information and provides high availability clusters. It communicates with the local client in the LAN and passes the <