- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

Building a Highly Available Prometheus Setup
A single Prometheus server can provide a great deal of value in terms of monitoring. However, it can also become a single point of failure if something goes wrong. Luckily, the simple architecture employed by Prometheus makes it relatively easy to set up additional Prometheus servers in a highly-available configuration. In this lab, you will see what this looks like as you build your own highly-available, multi-instance Prometheus setup.

Lab Info
Table of Contents
-
Challenge
Copy the Prometheus configuration from the existing Prometheus server to the new instance.
-
Log in to Prometheus Server 1.
-
Copy
prometheus.yml
to Prometheus Server 2.
scp /etc/prometheus/prometheus.yml [email protected]:/home/cloud_user
-
Log in to Prometheus Server 2.
-
Copy
prometheus.yml
to the appropriate location.
sudo cp ~/prometheus.yml /etc/prometheus/prometheus.yml
-
-
Challenge
Copy the rules configuration from the existing Prometheus server to the new instance.
- On Prometheus Server 1, view
prometheus.yml
to determine the rules location(s) underrule_files
:
cat /etc/prometheus/prometheus.yml
- Copy files from the rules directory to Prometheus Server 2:
scp /etc/prometheus/rules/* [email protected]:/home/cloud_user
- On Prometheus Server 2, create the rules directory, then copy the rules file to the appropriate location:
sudo mkdir -p /etc/prometheus/rules sudo cp ~/limedrop-alerts.yml /etc/prometheus/rules
- On Prometheus Server 1, view
-
Challenge
Start the new Prometheus instance and verify that everything is working.
- On Prometheus Server 2, start and enable Prometheus:
sudo systemctl enable prometheus sudo systemctl start prometheus
- Access Prometheus Server 2 in a browser at
http://<Prometheus Server 2 Public IP>:9090
. Run a query to verify that it is scraping metrics fromlimedrop-web
:
up{instance="limedrop-web:9100"}
- You can also click
Alerts
to verify that theWebServerDown
alert appears.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.