/
Stack installation
  • Rough draft
  • Stack installation

    This pages shows the different components that need to be installed so a monitoring server have all the necessary tools to:

    • Query language to check time-series data.

    • Scrap metrics from other servers.

    • Alerting system.

    • An app to monitor time-series data, alerts.

    This guide does not include configuration for each service. Each service should be configured to work accordingly with nginx and have connectivity between services.


    Prometheus

    Prometheus is an open-source tool that provides a query language for time-series data. It collects and stores metrics in a time-series database. To install prometheus the user must follow this steps:

    Download prometheus with the following command:

    sudo wget https://github.com/prometheus/prometheus/releases/download/v2.47.0/prometheus-2.47.0.linux-amd64.tar.gz

    Ā 

    Extract the files with the following command:

    sudo tar vxf prometheus*.tar.gz

    Ā 

    Create a System User for Prometheus:

    sudo groupadd --system prometheus sudo useradd -s /sbin/nologin --system -g prometheus prometheus

    Ā 

    Create Directories for Prometheus:

    Ā 

    Navigate to the Prometheus Directory:

    Ā 

    Move Files:

    Ā 

    Set Owner:

    Ā 

    Change Prometheus configuration file:

    Ā 

    Add the following initial configuration so prometheus server can start:

    Ā 

    Create prometheus service:

    Ā 

    Add the following configuration to the service file:

    Ā 

    Reload the daemon configuration:

    Ā 

    Enable Prometheus:

    Ā 

    Start Prometheus:

    Ā 

    Check that prometheus is running without issues:

    Ā 

    Prometheus is now running on port 9090


    Node Exporter

    Node exporter is an agent that extracts system metrics and expose that information so prometheus can read those metrics.

    Download node_exporter compressed pack:

    Extract the binary:

    Access the directory of the extracted file:

    Change folder execution permissions:

    Run node_exporter binary

    Run the following command to check the service status:

    Ā 

    Now node_exporter is running on port 9100.


    Grafana

    An open-source analytics and interactive visualization web application used for monitoring application performance.

    Install the prerequisite packages:


    Import the GPG key:

    Ā 

    To add a repository for stable releases, run the following command:


    To add a repository for beta releases, run the following command:


    Run the following command to update the list of available packages:


    To install Grafana OSS, run the following command:

    Ā 

    Now grafana is running on port 3000.


    Alertmanager

    Handles alerts sent by client applications such as the Prometheus server.

    Ā 

    Download prometheus alertmanager:

    Ā 

    Create prometheus user:

    Ā 

    Unpack alertmanager binary:

    Ā 

    Install prometheus alertmanager:

    Ā 

    Install prometheus alertmanager configuration file:

    Ā 

    Setup prometheus alertmanager service:

    Ā 

    Add the following configuration to the service file:

    Ā 

    Modify permissions to file:

    Ā 

    Reload systemd and start alertmanager service:

    Ā 

    Enable alertmanager service to be available on machine restart:

    Ā 

    Check alertmanager service status:

    Ā 

    Now alertmanager is running on port 9093.


    Telegraf

    An open source server agent that helps you collect metrics from your stacks, sensors, and systems.

    Run the following command to install telegraf from influxDB repository:

    For Telegraf to start pushing metric to influxDB the configuration file must be modified.


    InfluxDB

    A high performance Time Series Database which can store data ranging from hundreds of thousands of points per second.

    Update the OS packages:

    Ā 

    Setup the OS repositories to add influxdb:

    Ā 

    Update OS package list:

    Ā 

    Install influxDB:

    Ā 

    Check influxDB version:

    Ā 

    Start influxDB service:

    Ā 

    Enable the service so influxDB can be available on machine restart:

    Ā 

    Check the service status:

    Ā 

    InfluxDB is now available on port 8086

    Related content