Skip to main content
Welcome to the first lab of this course. In this lesson, we’ll cover two main tasks:
  1. Starting a Consul server in dev mode on your local machine
  2. Bootstrapping two AWS EC2 instances into a Consul cluster
Throughout the course, we’ll reuse these servers so you can follow along and observe how the cluster evolves.

1. Running Consul in Dev Mode

Running Consul in dev mode is intended for local testing only. Data is ephemeral and not suitable for production.

Start the Dev Agent

Open PowerShell (or your preferred shell) and launch the Consul agent:
You should see output similar to:

Verify the Local Agent

In a new shell, confirm the agent is running:
You’ll see a single-node entry. Then open your browser to explore the Consul UI: http://127.0.0.1:8500
The image shows a web interface for Consul, displaying a list of services with one instance labeled "consul." The interface includes options for searching and filtering by health status and service type.
To stop the agent, press Ctrl+C in the shell where it’s running.

2. Preparing AWS EC2 Instances

I’ve provisioned two EC2 instances and used Packer to install Consul under /usr/local/bin. Let’s verify everything:
You should see both consul.service and consul-snapshot.service.

3. Reviewing the Systemd Service File

Open /etc/systemd/system/consul.service to inspect how Consul is managed:
This unit ensures Consul starts after networking is available and points to our main configuration file.

4. Reviewing the Consul Configuration (Node A)

Below is the JSON-based configuration at /etc/consul.d/config.hcl for node A (10.0.101.110):
Key configuration parameters:

5. Starting Consul on Both Nodes

Open required ports (8300–8302, 8500, 8600) in your security groups before proceeding.

Node A

Node B

On the second instance (10.0.101.248), the /etc/consul.d/config.hcl is identical except for IP addresses and node_name:
Start the service:

Verify Cluster Membership

Run on either node:
Because of the retry_join settings, both servers automatically discover each other and form a cluster.
That concludes this lab. You’ve learned how to:
  • Run Consul in dev mode locally
  • Prepare EC2 instances and verify Consul installation
  • Inspect systemd service and configuration files
  • Bootstrap a two-node Consul server cluster on AWS

Watch Video

Practice Lab