# Overview

Docker (opens new window) and Docker Compose (opens new window) will allow you to run the required monitoring applications with a few commands. These instructions will run the following:

# Preparing your environment

  • You will need to install docker and docker-compose.
  • The following instructions assume Ubuntu 20.04 on an x86-64 CPU.

# Install Docker

  1. Remove older installations:
$ sudo apt-get remove docker docker-engine docker.io containerd runc
1
  1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:
 $ sudo apt-get update
 $ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
1
2
3
4
5
6
7
  1. Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
1
  1. Setup the docker stable repository:
$ echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
1
2
3
  1. Install docker:
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
1
2
  1. Test the installation:
$ sudo docker run hello-world
1

# Install Docker Compose

  1. Download the current stable release of Docker Compose:
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
1
  1. Apply executable permissions to the binary:
$ sudo chmod +x /usr/local/bin/docker-compose
1
  1. Test the installation:
$ docker-compose --version
1

# Setup and Configuration

  1. Clone the node_tooling repo (opens new window) and decend into the monitoring folder:
$ git clone https://github.com/LavenderFive/node_tooling.git
$ cd ./node_tooling/monitoring
1
2
  1. In the prometheus folder, modify cosmos.yaml, replace NODE_IP with the IP of your node. (If your node is on the docker host machine, use 172.17.0.1)
$ nano ./prometheus/cosmos.yaml
1
  1. Replace the default prometheus config with the modified cosmos.yaml
$ mv ./prometheus/prometheus.yml ./prometheus/prometheus.yml.orig
$ cp ./prometheus/cosmos.yaml ./prometheus/prometheus.yml
1
2

# Start the Containers

  1. Start the contrainers deploying the monitoring stack (Grafana + Prometheus + Node Exporter):
$ docker-compose --profile monitor up -d
1
  1. Login to Grafana at http://your-ip:3000 with username admin and password admin

The containers will restart automatically after rebooting unless they are stopped manually.

# Using the Cosmos SDK Grafana Dashboard

The dashboard for Cosmos SDK nodes is pre-installed, to use it:

  1. Enable Tendermint metrics in your game node
sed -i 's/prometheus = false/prometheus = true/g' <YOUR-NODE-HOMEDIR>/config/config.toml
1

After restarting your node, you should be able to access the tendermint metrics(default port is 26660): http://localhost:26660 (opens new window)

  1. (If you did not replace NODE_IP with the IP of your node in the prometheus config), do so now. (If your node is on the docker host machine, use 172.17.0.1)
$ nano ./prometheus/prometheus.yml
$ docker-compose down
$ docker-compose --profile monitor up -d
1
2
3
  1. Login to grafana and open the Cosmos Dashboard from the Manage Dashboards (opens new window) page.
  2. Set the chain-id to desired chain

# Application Ports

The docker images expose the following ports:

  • 3000 Grafana. Your main dashboard. Default login is admin\admin.
  • 9090 Prometheus. Access to this port should be restricted.
  • 9100 Node Exporter. Access to this port should be restricted.
  • Your game node metrics on port 26660 should also be restricted.

If you followed the basic security guide, these ports are already restricted. You will need to allow the grafana port:

sudo ufw allow 3000

You can also allow access from a specific IP if desired:

sudo ufw allow from 123.123.123.123 to any port 3000

# Stop the Containers

  1. From the node_tooling/monitoring directory:
$ docker-compose down
1