🐝
Networking & Server

Consul

Service discovery, health checks, and key-value store

🐧 Linux🍎 Mac🪟 Windows
Reviewed: Tested on: Kubernetes 1.29 · Terraform 1.8 · Ubuntu 22.04

What is this?

Consul helps services find each other and checks whether they are healthy.

📁

Config files for Consul

Where to create or edit the main configuration — paths below match the setup steps.

  • consul.hcl

    Location: /etc/consul.d/ or agent -config-dir

    Service discovery, connect, and ACL

📥

Step 01

Install Consul

(01)Install Consul

Linux
1wget https://releases.hashicorp.com/consul/1.19.0/consul_1.19.0_linux_amd64.zip
2unzip consul_1.19.0_linux_amd64.zip && sudo mv consul /usr/local/bin/
3consul agent -dev

Step 02

Verify

(01)Verify installation

Linux
1consul members
2# UI: http://localhost:8500
🔧

Step 03

Common Problems

#1Consul agent not joining cluster

Linux
1consul members
2consul info
3# Retry join:
4consul join <server-ip>