Dockerizing InfluxDB v2 (influxdbv2)

By default, the influxdb:2.0.0-alpha docker image uses the following key file locations (per InfluxDBv2 docs), but doesn’t mention setting them in the docker image documentation.

–bolt-path

Default: ~/.influxdbv2/influxd.bolt
InfluxDB uses BoltDB to store data including organization and user information, UI data, REST resources, and other key value data.

–engine-path

Default: ~/.influxdbv2/engine
Persistent storage engine files where InfluxDB stores all Time-Structure Merge Tree (TSM) data on disk.

Putting it Together…

Here’s how I run it in rancherOS using a volume mount for boltdb and the influx engine:

docker run -d --name influxdb --restart=unless-stopped \
-m "2048m" \
-p 9999:9999 \
--volume /home/rancher/influxdbv2:/root/.influxdbv2 \
quay.io/influxdb/influxdb:2.0.0-alpha --reporting-disabled

Docker Dashboard Template

By default, the Docker dashboard template has a few tiles that aren’t set up properly for a good first run – I had to remove this filter for 3 of the tiles to get a proper display of the “per container” metrics.

|> filter(fn: (r) => r.container_name == \"my-influxdb2\")