Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

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.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 45m
Published
Clock icon Jun 12, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Copy the Prometheus configuration from the existing Prometheus server to the new instance.

    1. Log in to Prometheus Server 1.

    2. Copy prometheus.yml to Prometheus Server 2.

    scp /etc/prometheus/prometheus.yml [email protected]:/home/cloud_user
    
    1. Log in to Prometheus Server 2.

    2. Copy prometheus.yml to the appropriate location.

    sudo cp ~/prometheus.yml /etc/prometheus/prometheus.yml
    
  2. Challenge

    Copy the rules configuration from the existing Prometheus server to the new instance.

    1. On Prometheus Server 1, view prometheus.yml to determine the rules location(s) under rule_files:
    cat /etc/prometheus/prometheus.yml
    
    1. Copy files from the rules directory to Prometheus Server 2:
    scp /etc/prometheus/rules/* [email protected]:/home/cloud_user
    
    1. 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
    
  3. Challenge

    Start the new Prometheus instance and verify that everything is working.

    1. On Prometheus Server 2, start and enable Prometheus:
    sudo systemctl enable prometheus
    
    sudo systemctl start prometheus
    
    1. 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 from limedrop-web:
    up{instance="limedrop-web:9100"}
    
    1. You can also click Alerts to verify that the WebServerDown alert appears.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

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.

Start learning by doing today

View Plans