External Monitoring

This page describes how to set up external monitoring using Prometheus and Grafana

Overview

The Weka GUI allows monitoring basic information of the CPUs, Network, Drives, IOPS/Throughput, and more advanced information via the statistics.

It is sometimes useful to use external tools like Prometheus and Grafana for monitoring. It could be that you already have them in the environment and would like to correlate with other products and see all information on the same dashboard.

In this guide, we will learn how to easily set-up a nice Grafana dashboard to monitor Weka. We will use a custom Prometheus client that presents weka statistics.

It is advisable to set-up a machine (or a VM) to run the external services used if you do not already have those running in the environment.

The easiest way to set up a Grafana environment is with Docker. For that, make sure docker-ce is installed on that machine. Installation instructions for installing Docker are on the Docker website.

Step 1: Install Prometheus, Grafana and Weka Metrics Exporter

Run the following commands to install the Docker Containers for Grafana, Prometheus, and Weka's metrics exporter:

# Get the Grafana container from Docker Hub:
docker pull grafana/grafana
# Get the Prometheus container from Docker Hub:
docker pull prom/prometheus
# Get the Weka metrics exporter from Docker Hub:
docker pull wekasolutions/metrics-exporter

Step 2: Download the Grafana Dashboards for Weka

Weka provides some examples of Grafana Dashboards to display data collected from Weka. To get and set them up, execute the following commands:

# Get the Weka Dashboards for Grafana from Github:
git clone http://github.com/weka/grafana-dashboards
# Set up the environment so Prometheus has a place to save data
cd grafana-dashboards
./set_permissions.sh

Step 3: Run Prometheus, Grafana and Weka Metrics Exporter

To get everything going, all that needs to be done is to start the containers:

docker run -d --net=host --restart unless-stopped --mount type=bind,source=$PWD/etc_grafana_provisioning/,target=/etc/grafana/provisioning --mount type=bind,source=$PWD/var_lib_grafana_dashboards/,target=/var/lib/grafana/dashboards grafana/grafana
docker run -d --net=host --restart unless-stopped --mount type=bind,source=$PWD/etc_prometheus/prometheus.yml,target=/etc/prometheus/prometheus.yml --mount type=bind,source=$PWD/prometheus_data,target=/prometheus prom/prometheus
docker run -d --network=host \
--mount type=bind,source=/root/.weka/,target=/weka/.weka/ \
--mount type=bind,source=/dev/log,target=/dev/log \
wekasolutions/metrics-exporter -vv -a <clustersepc>

clusterspec is as a list of hostnames, auth-token file, e.g.: weka01,weka02,weka03:~/.weka/auth-token.json, with the minimum being a single Weka host.

The auth-token file is generated by the weka cluster login command.

Multiple clusters may be monitored by listing multiple clusterspec.

Note: Please see https://github.com/weka/weka-metrics-exporter for more detailed documentation and documentation on how to run the exporter without Docker or running the exporter with an existing Grafana/Prometheus installation.

Step 4: Monitor the Weka Cluster

Prometheus server is available on port 9090: http://[HOSTNAME]:9090

Grafana server is available on port 3000: http://[HOSTNAME]:3000

Weka exporter is available on port 8001: http://[HOSTNAME]:8001

The previous steps set the Weka exporter to push data to the Prometheus instance, set Prometheus as a data source to the Grafana instance, and pre-populated Grafana with the pre-build Weka dashboard.

To monitor the cluster, simply connect to Grafana and view the pre-populated Weka dashboards.