Skip to content

πŸ“… Install Prometheus Server

πŸ“ Overview

There are two ways to deploy Prometheus Server:

  • Manual Download the installation script and define Environment Variable
  • Upload the install script from EdgeHit Controller that presets all the Necessary Value

Both way are invoking the installation Script at

https://files.ops2.net/edgehit/prod/prometheus/deploy/install.sh
The generated script from EdgeHit Controller is just a Script that predifine Environment Variable and run the script above.

Note

Node-Exporter are installed to EdgeHit Controller and Load Proxy with Authentication using HTTP AUTH. Therefore the Prometheus Server needs to be configured with the coresponding PSK for each target


For reference, below shows what are the Environment Variable defined in
install-prometheus.sh:

Variable Configured Value
DASH_SERVER_DOMAIN same as the value defined during EdgeHit Controller installation
DASH_HTTP_AUTH_PASS PSK generated for HTTP AUTH of Node-Exporter running on EdgeHit Controller
EDGE_HTTP_AUTH_PASS PSK generated for HTTP AUTH of Node-Exporter running on Load Proxy
PROM_SERVER_DOMAIN same as DASH_SERVER_DOMAIN

Info

You need to change the PROM_SERVER_DOMAIN value to match the Domain Name of the Prometheus Server if it is not deployed on EdgeHit Controller.

The best way to install Prometheus server is by using the install-prometheus.sh on EdgeHit Controller.



πŸͺœ Installation Step

  1. Defining Prometheus Server Domain Name before installation

    install-prometheus.sh assume that Prometheus Server is Downloaded to EdgeHit Controller by default. In production Environment. You need to change Environement Value to Domain Name pointing to the taget installation Server.

    Redundant Prometheus Target Scenario

    The installation Script itself contain a Node-Exporter Installation. If the Prometheus Server is installed on EdgeHit Controller, it will result in two Node-Exporter instance on the Same Machine

    For reference, you need to change the value below for the script

    Environment Variable Value
    PROM_SERVER_DOMAIN Domain Name of Installation Target


    2. Upload the Script to Target Machine

    On Local Terminal
    scp /path/to/local/destination/install-prometheus.sh root@<Target>:~/  
    

  2. Execute the script

    chmod 700 ./install-prometheus.sh
    ./install-prometheus.sh
    

    • Once the installation is done, installation info and administrative tools will be stored in /usr/local/edgehit/prometheus/ the directory content will be similiar as below:

          prometheus/
          β”œβ”€β”€.env
          β”œβ”€β”€install-info.txt
          β”œβ”€β”€compose.yml
          β”œβ”€β”€bin/
          β”‚ β”œβ”€β”€ bash Scripts
          β”‚ └── more bash Scripts 
          β”‚ └── .....
      
    • .env contain secret value such as the PSK for Connecting to Node-Exporter using HTTP-AUTH that is mounted to docker container runtime

    • install-info.txt contain info such as default user and password for Grafana, Prometheus, and Alert Manager Web Dashboard

After installation, you can configure the initial setting of the prometheus and grafana server. Detail will be discussed in Configuring Prometheus Target section.