---
agentTools:
  projectIndex: https://docs.project-fifo.net/llms.txt
---

# Installation

Metric Setup Guide

For the purposes of this guide, we will be setting up a single zone for DalmatinerDB, Tachyon, and NSQ with the below ip address and services. *Note: For production setups its recommended you run multiple separated NSQ processes as well as a distributed DalmatinerDB Database.*

Our setup will be as follows:

[block:parameters]
{
  "data": {
    "h-0": "Zone Name",
    "h-1": "IP Address",
    "h-2": "Services",
    "h-3": "Hypervisor",
    "0-0": "DalmatinerDB Zone 1",
    "0-1": "10.1.1.24",
    "0-3": "1",
    "0-2": "Dalmatinerdb, Dalmatinerfe, NSQ, Tachyon, Grafana",
    "1-0": "Hypervisors Global Zone",
    "1-2": "Tachyon-Meter",
    "1-3": ""
  },
  "cols": 4,
  "rows": 2
}
[/block]

The Grafana and Dalmatinerfe part of this guide are **optional**. Grafana is a dashboard builder for building custom graphs using metric data stored in the database. DalmatinerFE is a very simplistic web frontend to show you the different "buckets" and metric data stored within your DalmatinerDB database.

[block:api-header]
{
  "type": "basic",
  "title": "(Step 1) Create Zone"
}
[/block]

Please see the [Requirements](https://docs.project-fifo.net/docs/fifo-requirements) section for details on the requirements for datasets and the GZ.

Sample contents of `1.dalmatinerdb.json`

[block:code]
{
  "codes": [
    {
      "code": "{\n \"autoboot\": true,\n \"brand\": \"joyent\",\n \"image_uuid\": \"<image uuid>\",\n \"delegate_dataset\": true, \n \"max_physical_memory\": 2048,\n \"cpu_cap\": 100,\n \"alias\": \"1.dalmatinerdb\",\n \"quota\": \"80\",\n \"zfs_root_compression\": \"on\",\n \"resolvers\": [\n  \"8.8.8.8\",\n  \"8.8.4.4\"\n ],\n \"nics\": [\n  {\n   \"interface\": \"net0\",\n   \"nic_tag\": \"admin\",\n   \"ip\": \"10.1.1.24\",\n   \"gateway\": \"10.1.1.1\",\n   \"netmask\": \"255.255.255.0\"\n  }\n ]\n}",
      "language": "json",
      "name": "1.dalmatinerdb.json"
    }
  ]
}
[/block]

Next we create our DalmatinerDB JSON payload files and create our zone.

[block:code]
{
  "codes": [
    {
      "code": "cd /opt\nvi 1.dalmatinerdb.json\nvmadm create -f 1.dalmatinerdb.json",
      "language": "shell"
    }
  ]
}
[/block]

The rest of the setup will be done within our newly created DalmatinerDB zone.

[block:api-header]
{
  "type": "basic",
  "title": "(Step 2) Zone Configuration"
}
[/block]

We now zlogin into the DalmatinerDB Zone

[block:code]
{
  "codes": [
    {
      "code": "zlogin <zone-uuid>",
      "language": "shell"
    }
  ]
}
[/block]

First we do need to configure the delegate dataset to be mounted to `/data` we can do this from within the zone with the following command:

[block:code]
{
  "codes": [
    {
      "code": "zfs set mountpoint=/data zones/$(zonename)/data",
      "language": "shell"
    }
  ]
}
[/block]

Add the FiFo package repository then install the "**dalmatinerfe**", "**dalmatinerdb**", "**nsq**" and "**tachyon**" services.

[block:code]
{
  "codes": [
    {
      "code": "VERSION=rel\necho \"http://release.project-fifo.net/pkg/${VERSION}\" >> /opt/local/etc/pkgin/repositories.conf\n\ncurl -O https://project-fifo.net/fifo.gpg\ngpg --primary-keyring /opt/local/etc/gnupg/pkgsrc.gpg --import < fifo.gpg\ngpg --keyring /opt/local/etc/gnupg/pkgsrc.gpg --fingerprint\n\npkgin -fy up\npkgin in dalmatinerfe dalmatinerdb nsq tachyon",
      "language": "shell"
    }
  ]
}
[/block]

Next we configure all the services in the Zone and edit each respective configuration file and changing **ONLY** the following settings - the rest of the config options will remain **unchanged**:

[block:code]
{
  "codes": [
    {
      "code": "svcadm enable epmd\nsvcadm enable nsqadmin\nsvcadm enable nsqlookupd\nsvcadm enable nsqd\nsvcs epmd nsqadmin nsqlookupd nsqd\n\nvi /data/dalmatinerdb/etc/dalmatinerdb.conf\nvi /data/dalmatinerfe/etc/dalmatinerfe.conf",
      "language": "shell"
    }
  ]
}
[/block]

## dalmatinerdb.conf

`vi /data/dalmatinerdb/etc/dalmatinerdb.conf`

[block:code]
{
  "codes": [
    {
      "code": "nodename = dalmatinerdb@10.1.1.24\nhandoff.ip = 10.1.1.24\nlifetime = infinity",
      "language": "text"
    }
  ]
}
[/block]

Note: You may want to adjust the `lifetime = infinity` value to something that matches your storage and data retention policies. As it stands, the `infinity` value will continue to store data until you run out of disk space.

## dalmatinerfe.conf

`vi /data/dalmatinerfe/etc/dalmatinerfe.conf`

[block:code]
{
  "codes": [
    {
      "code": "backend_server = 10.1.1.24:5555\nnodename = dalmatinerfe@10.1.1.24",
      "language": "text"
    }
  ]
}
[/block]

Next we start the services and confirm they are running:

[block:code]
{
  "codes": [
    {
      "code": "svcadm enable epmd\nsvcadm enable dalmatiner/db\nsvcadm enable dalmatiner/fe\nsvcs epmd dalmatiner/db dalmatiner/fe",
      "language": "shell"
    }
  ]
}
[/block]

Next run the `ddb-admin buckets` command to confirm that the bucket is showing and check the time to live via `ddb-admin ttl dalmatinerdb` which by default is set to infinity.

[block:code]
{
  "codes": [
    {
      "code": "$ ddb-admin buckets\ndalmatinerdb\n\n$ ddb-admin ttl dalmatinerdb\ninfinity",
      "language": "shell"
    }
  ]
}
[/block]

You should now be able to access the DDB Web Frontend and see your bucket. Point your web browser at `http://10.1.1.24:8080/`

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/LWfvrRFlRLedUdTlckGc_ddbfe2.png",
        "ddbfe2.png",
        "657",
        "158",
        "#0692b4",
        ""
      ]
    }
  ]
}
[/block]

Now we configure and start the Tachyon Aggregator service:

## tachyon.conf

`vi /data/tachyon/etc/tachyon.conf`

[block:code]
{
  "codes": [
    {
      "code": "ddb = 10.1.1.24:5555",
      "language": "text",
      "name": "tachyon.conf"
    }
  ]
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "svcadm enable epmd\nsvcadm enable tachyon\nsvcs tachyon",
      "language": "shell"
    }
  ]
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "(Step 3) Setup Tachyon-meter in the Global Zone"
}
[/block]

Return to the **global zone** of your hypervisor/s and download and install the **tachyon-meter** service. This is a service that gathers and distributes KSTAT metrics to NSQ which send it to the Tachyon Aggregator which optimizes it before sending it to DalmatinerDB.

[block:code]
{
  "codes": [
    {
      "code": "cd /opt\ncurl -O http://release.project-fifo.net/gz/rel/tachyon-meter-latest.gz\ngunzip tachyon-meter-latest.gz\nsh tachyon-meter-latest",
      "language": "shell"
    }
  ]
}
[/block]

Now we configure and start the **Tachyon Meter** service:

## tachyon.conf

`vi /opt/tachyon-meter/etc/tachyon.conf`

[block:code]
{
  "codes": [
    {
      "code": "host=10.1.1.24",
      "language": "text",
      "name": "tachyon.conf"
    }
  ]
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "svcadm restart tachyon-meter\nsvcs tachyon-meter",
      "language": "shell"
    }
  ]
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "(Step 4) Configure FiFo Zone for Metrics & DalmatinerDB"
}
[/block]

Final step is to **zlogin** to your **FiFo Zone** and edit the following file and change the DDB ip and port to the ip of the zone running DalmatinerDB.

[block:code]
{
  "codes": [
    {
      "code": "vi /data/sniffle/etc/sniffle.conf\nvi /data/snarl/etc/snarl.conf\nvi /data/howl/etc/howl.conf",
      "language": "shell"
    }
  ]
}
[/block]

## sniffle.conf

[block:code]
{
  "codes": [
    {
      "code": "folsom_ddb.ip = 10.1.1.24:5555",
      "language": "text"
    }
  ]
}
[/block]

## snarl.conf

[block:code]
{
  "codes": [
    {
      "code": "folsom_ddb.ip = 10.1.1.24:5555",
      "language": "text"
    }
  ]
}
[/block]

## howl.conf

[block:code]
{
  "codes": [
    {
      "code": "folsom_ddb.ip = 10.1.1.24:5555\nddb_connection.backend_host = 10.1.1.24:5555",
      "language": "text"
    }
  ]
}
[/block]

Restart your services and login to Cerberus UI and you should now see working metric graphs shown for both vm's and hypervisors.

[block:code]
{
  "codes": [
    {
      "code": "svcadm restart sniffle\nsvcadm restart snarl\nsvcadm restart howl\nsvcs sniffle snarl howl",
      "language": "shell"
    }
  ]
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "(Step 5) optional -  Grafana setup"
}
[/block]

Since Grafana does not ship with support for a native  DalmatinerDB datasource we maintain a special fork that includes support.

At present, a precompiled binary of Grafana with our changes can be downloaded [here](http://release.project-fifo.net/chunter/rel/grafana-2.0.2.tgz).

For the purposes of this guide we will run Grafana in the same zone as DalmatinerDB. **Zlogin** to the **DalmatinerDB** zone and install and run the binary.

[block:code]
{
  "codes": [
    {
      "code": "curl -O http://release.project-fifo.net/chunter/rel/grafana-2.0.2.tgz\ntar -xvzf grafana-2.0.2.tgz\ncd grafana\n./grafana",
      "language": "shell"
    }
  ]
}
[/block]

You can now login to the Grafana Web Interface on `http://10.1.1.24:3000` the default username and password is **admin** / **admin**

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/Adz6pTARfusvsid9B7Qg_grafana1.png",
        "grafana1.png",
        "740",
        "478",
        "#056c94",
        ""
      ]
    }
  ]
}
[/block]

Add and configure your data source then start creating custom graphs. Have fun!

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/wd0JY3SJS4CX4G6DhPv4_grafana3-1.png",
        "grafana3-1.png",
        "907",
        "444",
        "#6c9e4a",
        ""
      ]
    }
  ]
}
[/block]

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/cxImg5ZBQ82cax5DxV6Z_grafana4-1.png",
        "grafana4-1.png",
        "1042",
        "279",
        "#ca7e7f",
        ""
      ]
    }
  ]
}
[/block]