Skip to content

Instantly share code, notes, and snippets.

@sacreman
Last active June 14, 2018 06:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sacreman/9015bf466b4fa2a654486cd79b777e64 to your computer and use it in GitHub Desktop.
Save sacreman/9015bf466b4fa2a654486cd79b777e64 to your computer and use it in GitHub Desktop.

DalmatinerDB Installation Guide (Linux)

These instructions outline how to install DalmatinerDB on a single Linux x86_64 physical server or virtual machine. Scaling out will be covered in a future document. This setup guide also covers configuring CAdvisor and Telegraf to send in monitoring data and Grafana to build dashboards.

Here's how everything connects together:

dalmatiner architecture

Create a VM

Ubuntu 16.04 with at least 4 cpu cores, 8GB memory and SSD disk is recommended for testing.

Create a ZFS filesystem

DalmatinerDB relies on ZFS for compression and a bunch of other features. While it is possible to skip this step is is not recommended.

apt-get update && apt-get install zfs

cd / && touch vdev1 && truncate -s 900G vdev1 # change 900G to appropriate allocation

zpool create data /vdev1

zfs create data/ddb -o compression=lz4 -o atime=off -o logbias=throughput

chown dalmatiner. /data/ddb

Install DalmatinerDB

Storage

DalmatinerDB receives binary data over port 5555 and writes it to disk. It's important to configure the settings to write to the ZFS partition setup in the previous step. DalmatinerDB is built on Riak Core and includes many ddb-admin commands which can be used to dynamically scale the cluster to improve write performance.

wget http://deb.project-fifo.net/releases/latest/dalmatinerdb_0.2.0_amd64.deb

dpkg -i dalmatinerdb_0.2.0_amd64.deb

vi /etc/ddb/dalmatinerdb.conf # change platform_data_dir = /data/ddb

service ddb start

Query Engine

The query engine talks to the DalmatinerDB over port 5555 and serves up a web front end on port 8080 for running test queries. Grafana also talks to port 8080 via the data source plugin. Query engines are stateless and can be moved onto dedicated servers to scale query performance.

wget http://deb.project-fifo.net/releases/latest/dalmatiner-frontend_0.2.0_amd64.deb

dpkg -i dalmatiner-frontend_0.2.0_amd64.deb

service dfe start

Setup Postgres

Postgres is used to store metric metadata i.e. tags/dimensions/labels and is the index for the metric storage. Postgres can be scaled out onto its own cluster to scale which is typically a master and a slave. It would be extremely surprising if you ever need to scale Postgres beyond a single node, given the task it performs and frequency that the index updates, even if you are a SaaS metrics company. However if you do somehow manage to achieve such a scale we would recommend looking at Citus as an option.

curl -s http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -

echo 'deb http://apt.postgresql.org/pub/repos/apt precise-pgdg main 9.5' > /etc/apt/sources.list.d/postgresql.list

apt-get update && apt-get install postgresql-9.5

service postgresql start

su - postgres -c "psql -f /var/lib/dfe/schema.sql"

service dfe restart

Install Grafana

Grafana talks to the query engine and serves up a web page on port 3000. In addition to the steps below you will need to login into Grafana (default is admin/admin) and create a DalmatinerDB data source. The address to use is http://server_ip:8080 and it's probably a good idea to make it the default data source.

curl https://packagecloud.io/gpg.key | sudo apt-key add -

echo 'deb https://packagecloud.io/grafana/stable/debian/ wheezy main' > /etc/apt/sources.list.d/grafana.list

apt-get update && apt-get install grafana

service grafana-server start

git clone https://github.com/dalmatinerdb/dalmatinerdb-datasource.git /var/lib/grafana/plugins/dalmatinerdb

service grafana-server restart

Install DDB Proxy

The DalmatinerDB binary protocol isn't the easiest thing to use in its raw format. Luckily you can run a proxy and ignore the binary stuff. We recommend sending metrics into the proxy via either OpenTSDB telnet protocol on port 4242 or InfluxDB http endpoint on port 8086. The proxy can also scrape Prometheus endpoints but without service discovery this is limited. Prometheus are currently working on a generic long term storage API that we will integrate with when finished. Proxies are stateless, you can run as many of them as you want.

wget http://deb.project-fifo.net/releases/latest/ddb-proxy_0.1.0_amd64.deb

dpkg -i ddb-proxy_0.1.0_amd64.deb

service ddb_proxy start

Setup Telegraph

By default Telegraf will output metrics to http://localhost:8086 which is what the DalmatinerDB proxy runs by default.

wget https://dl.influxdata.com/telegraf/releases/telegraf_0.13.2_amd64.deb

dpkg -i telegraf_0.13.2_amd64.deb

service telegraf restart

Docker Monitoring

You may also want to have a play around with monitoring Docker containers. The simplest and quickest way to monitor those is to spin up a CAdvisor container on each of your docker hosts with the following settings that enable the InfluxDB storage driver. You will need to change ddb_proxy_ip to match the IP address of the server running the DalmatinerDB proxy.

sudo docker run \
  --volume=/:/rootfs:ro \
  --volume=/var/run:/var/run:rw \
  --volume=/sys:/sys:ro \
  --volume=/var/lib/docker/:/var/lib/docker:ro \
  --publish=8080:8080 \
  --detach=true \
  --name=cadvisor \
  google/cadvisor:latest \
  -storage_driver=influxdb \
  -storage_driver_host=ddb_proxy_ip:8086
@grinapo
Copy link

grinapo commented Feb 6, 2017

The links above are dead.

@saichandra286
Copy link

yaaa the above link is dead, @grinapo did you find any alternate way to install DalmatinerDB on Ubuntu 16.04.
thanx in advance

@antizhou
Copy link

how to run in centos?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment