Skip to main content
The image is mostly black with a small, dark purple rectangle in the bottom right corner.
In this tutorial, you’ll learn how to view your current Consul cluster, add a new client agent, and remove an agent—either gracefully or forcefully. This ensures your service mesh remains healthy and up to date.

Viewing the Current Cluster

On your server node (consul-node-a), verify the existing members and Raft peers:
Example output:
consul-node-a is the Raft leader, while consul-node-b is a follower. Maintaining at least three servers is recommended for high availability.

Cluster Members Overview

NodeAddressStatusTypeDCSegment
consul-node-a10.0.101.110:8301aliveserverus-east-1<all>
consul-node-b10.0.101.248:8301aliveserverus-east-1<all>

Adding a New Client Agent

  1. Prepare the client config
    On your new machine (web-server-01), create /etc/consul.d/config.hcl:
  2. Start the Consul agent
  3. Verify local membership
    Expected:
  4. Join the cluster
  5. Confirm membership across the cluster
    All nodes:
For automatic retries, add a retry_join block in your client config. You can also leverage cloud auto-join or gossip keys—see Consul auto-join for details.

Removing a Client Agent

Graceful Leave

On the client (web-server-01), run:
On any server, you’ll see the client marked as left:

Forceful Removal

If a client is unresponsive or destroyed, use force-leave with pruning:
force-leave is destructive and should only be used when an agent cannot leave gracefully. It immediately prunes the node from the membership list.

References

Watch Video

Practice Lab