Deploying Scylla Monitoring versions 2.1 and higher Without Docker

The following instructions will help to deploy Scylla Monitoring Stack in the case you can not use the docker version.

Please note, Scylla recommends you use the docker version as it will provide you with most updated, current scylla monitoring system.

Minimal Production System Recommendations

  • CPU - at least 2 physical cores/ 4vCPUs
  • Memory - 15GB+ DRAM
  • Disk - persistent disk storage is porportional to the number of cores and Prometheus retention period (see the following section)
  • Network - 1GbE/10GbE preferred

Calculating Prometheus Disk Space requirement

Prometheus Storage requirement is proportional to the number of metrics it holds. The default retention period is 15 days, and the disk requirement is around 200MB per core.

For example, when monitoring a 6 node Scylla cluster, each with 16 CPU cores, and using the default 15 days retention time:

6 * 16 * 200MB ~ 20GB

The main item to set an alert on is the available disk space in the monitoring system. Data is indefinitely accrued on the Prometheus data directory. The current monitoring solution does not churn data.

Install Scylla Monitor

The following procedure is using a CentOS 7 based instance

  1. Download the latest monitoring release. Currently it is 2.2

wget https://github.com/scylladb/scylla-grafana-monitoring/archive/scylla-monitoring-2.2.tar.gz

  1. open the tar

tar -xvf scylla-monitoring-2.2.tar.gz

Install Alertmanager

Tested with alertmanager 0.16.0 version

  1. Install alertmanager
  1. Copy the following file: rule_config.yml from scylla-grafana-monitoring-scylla-monitoring-2.2/prometheus directory to alertmanager.yml in the alertmanager installation directory.

For example:

cp -p /home/centos/scylla-grafana-monitoring-scylla-monitoring-2.2/prometheus/rule_config.yml /home/centos/alertmanager-0.16.0.linux-amd64/alertmanager.yml
  1. Start the Alertmanager

For example:

./alertmanager
  1. Verify that Alertmanager is up and running, point your browser to the Alertmanager IP:Port

For example:

http://192.168.135.166:9093/
../../../_images/alertmanager.png

Install Prometheus

Tested with prometheus 2.6.1 version

  1. Install Prometheus
  1. Copy the following files: scylla_servers.yml, node_exporter_servers.yml, prometheus.rules.yml from scylla-grafana-monitoring-scylla-monitoring-2.2/prometheus directory to prometheus installation directory.

Copy prometheus/prometheus.yml.template to prometheus.yml

For example:

cp -p /home/centos/scylla-grafana-monitoring-scylla-monitoring-2.2/prometheus/*.yml /home/centos/prometheus-2.6.1.linux-amd64
  1. Edit the prometheus.yml file to point to the correct static data sources.

Note

Make sure to include the honor_labels: false parameter in the prometheus.yml file.

sudo vi /<prometheus_installation_location>/prometheus-2.6.1.linux-amd64/prometheus.yml

Set the alertmanger address and port by replacing AM_ADDRESS in the file.

For example if the alertmanager will run on the same host:

alerting:
   alertmanagers:
   - static_configs:
       - targets:
           - 127.0.0.1:9093

For example the scrap config for scylla:

global:
  scrape_interval: 5s # By default, scrape targets every 5 second.
  scrape_timeout: 4s # Timeout before trying to scape a target again

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
    monitor: 'scylla-monitor'

scrape_configs:
- job_name: scylla
  honor_labels: false
  file_sd_configs:
    - files:
      - /home/centos/prometheus-2.6.1.linux-amd64/scylla_servers.yml
  relabel_configs:
   - source_labels: [__address__]
     regex:  '(.*):.+'
     target_label: instance
     replacement: '${1}'
  1. Edit the, scylla_servers.yml, node_exporter_servers.yml and scylla_manager_serer.yml files to point to your Scylla nodes.

Note

From Scylla Monitoring version 2.2, you no longer need to configure node_exporter_server. Instead, in the prometheus scrap config of the node_exporter you can use the same file you used for scylla and Prometheus will assume you have a node_exporter running on each Scylla server.

Add the labels for the cluster and data-center

scylla_servers.yml:

For example:

cat scylla_servers.yml
# List Scylla end points

- targets:
  - 192.168.66.6:9180
  - 192.168.66.244:9180
  labels:
    cluster: cluster1
    dc: dc1
- targets:
    - 172.17.0.3:9180
  labels:
    cluster: cluster1
    dc: dc2

Note

See the previous note about deprecating the node_exporter_servers.yml file.

node_exporter_servers.yml:

For example:

cat node_exporter_servers.yml
# List end points with node exporter

- targets:
  - '192.168.66.6:9100'
  - '192.168.66.244:9100'
  labels:
    cluster: cluster1
    dc: dc1
- targets:
    - 172.17.0.3:9100
  labels:
    cluster: cluster1
    dc: dc2

scylla_manager_serer.yml

For example:

- targets:
  - 127.0.0.1:56090
  1. Create a data directory for prometheus to store the metrics data

For example:

sudo mkdir /home/centos/prometheus-2.6.1.linux-amd64/mydata
  1. Start Prometheus server:

For example:

sudo ./prometheus --config.file=prometheus.yml --storage.tsdb.path /home/centos/prometheus-2.6.1.linux-amd64/mydata

Data should start accumulate on: /home/centos/prometheus-2.6.1.linux-amd64/mydata

  1. Verify that Prometheus is up and running, point your browser to the Prometheus IP:Port

For example:

http://192.168.135.166:9090/
../../../_images/1.png

Prometheus console should be visible

  1. Verify that the node_expoerter and scylla metrics accumulating in the server by executing a query through the console

For example:

node_memory_MemFree

../../../_images/2.png

And

scylla_reactor_utilization

../../../_images/3.png

At this point Scylla is emitting the metrics and Prometheus is able to store them.

Install Grafana

  1. Install Grafana base on the instructions here make sure to use version 5.0.0 or higher

Depends if you installed Grafana from a repository (yum install), or if you downloaded the zip version, the directory structure will be different in the rest of the steps.

  1. Access Scylla-Grafana-monitoring directory

cd /home/centos/scylla-grafana-monitoring-scylla-monitoring-2.2/

  1. Copy the plugins to the grafana plugins directory (by default /var/lib/grafana/)
sudo cp -r grafana/plugins /var/lib/grafana/

If you installed Grafana from packages, instead of /var/lib/grafana/ you should copy it to public/app inside the directory you opened Grafana in.

For example:

cp -r grafana/plugins /home/centos/grafana-5.4.3/public/app
  1. Generate the dashboards you would like to load and provision them

For example scylla version 3.0 and scylla manager version 1.3

./generate-dashboards.sh -v 3.0 -M 1.3

For Grafana installed with yum install

sudo cp grafana/provisioning/dashboards/load.* /etc/grafana/provisioning/dashboards/
sudo mkdir -p /var/lib/grafana/dashboards
sudo cp -r grafana/build/* /var/lib/grafana/dashboards

For Grafana installed from packages

cp -p -r grafana/build/* /home/centos/grafana-5.4.3/public/build/
cp -p grafana/provisioning/dashboards/load.* /home/centos/grafana-5.4.3/conf/provisioning/dashboards/

Edit the load.* files in /home/centos/grafana-5.4.3/conf/provisioning/dashboards/ for the correct path, for example load.3.0.yaml would point to: /home/centos/grafana-5.4.3/public/build/ver_3.0

  1. Set the data source by copy datasource.yml and edit it
sudo cp grafana/datasource.yml /etc/grafana/provisioning/datasources/

For Grafana installed from packages

cp -p grafana/datasource.yml /home/centos/grafana-5.4.3/conf/provisioning/datasources/

You should set the prometheus and the alertmanager ip and port.

For example

sudo cat /etc/grafana/provisioning/datasources/datasource.yml
apiVersion: 1
datasources:
 - name: prometheus
   type: prometheus
   url: http://192.168.135.167:9090
   access: proxy
   basicAuth: false

 - name: alertmanager
   type: camptocamp-prometheus-alertmanager-datasource
   orgId: 1
   typeLogoUrl: public/img/icn-datasource.svg
   access: proxy
   url: http://192.168.135.166:9093
   password:
   user:
   database:
   basicAuth:
   isDefault:
   jsonData:
     severity_critical: '4'
     severity_high: '3'
     severity_warning: '2'
     severity_info: '1'
  1. Start the Grafana service

For Grafana installed with yum install

sudo service grafana-server start

For Grafana installed from packages:

cp -p /home/centos/grafana-5.4.3/conf/sample.ini /home/centos/grafana-5.4.3/conf/scylla.ini

Edit scylla.ini to reflect the right paths in the paths section of the file.

plugins = /home/centos/grafana-5.4.3/public/app/plugins
provisioning = /home/centos/grafana-5.4.3/conf/provisioning

Start the server:

cd /home/centos/grafana-5.4.3/
./bin/grafana-server -config /home/centos/grafana-5.4.3/conf/scylla.ini
  1. Make sure Grafana is running

Point your browser to the Grafana server port 3000, the assumption is that Grafana and Prometheus are collocated on the same server.

../../../_images/grafana.png

Monitoring Scylla