- Lab
- A Cloud Guru
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.
Path 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.
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.