Influxdb Installation Guide with Docker
In this guide we will see how we can manage Influxdb Installation with Docker, creating administrator user and enabling authentication
Influxdb is a famous Time Series Database, able to ingest and collect millions of measurements, useful for network monitoring, to generate performance graphs and states of hosts and services
Docker allows us to perform rapid deployments, maintain consistent containerized environments in development, test and production ensuring reliability for customers with our Docker support
Installation of InfluxDB
For a quick installation we used the official InfluxDB container available Dockerhub, for installation this short guide is available. Installing Docker in Debian
To make the configuration and data permanent, volumes were created, mounted on the filesystem in /docker/influxdb
We have also enabled the reception of exported metrics from Collectd and Graphite by exposing the TCP 8086 and UDP 25826 ports, we also need to download the types-db, to tag the metrics from Collectd
We can download it from the CollectD project git: types-db. Using this script let's place it in /docker/influxdb/types-db/collectd-types.db
VERSION="1.6.4-alpine"
APP="/docker"
INFLUX_ROOT="$APP/influxdb"
INFLUX_DATA="$INFLUX_ROOT/data"
INFLUX_CONF="$INFLUX_ROOT/etc"
INFLUX_TYPESDB="$INFLUX_ROOT/types-db"
# Directory creation
mkdir -p $INFLUX_DATA ; mkdir -p $INFLUX_CONF
docker run --name=influxdb \
--restart=always \
-p 8086:8086 \
-p 25826:25826/udp \
-e INFLUXDB_GRAPHITE_ENABLED=true \
-v $INFLUX_DATA:/var/lib/influxdb \
-v $INFLUX_CONF/influxdb.conf:/etc/influxdb/influxdb.conf:ro \ \
-v $INFLUX_TYPESDB/collectd-types.db:/usr/share/collectd/types.db:ro \
influxdb:$VERSION -config /etc/influxdb/influxdb.confAdministrator user creation
At this point you need to create an admin account by executing commands within the Docker container
docker exec -en influxdb bash
influxWithin the database console:
CREATE USER adminname WITH PASSWORD 'passwordsupersecure' WITH ALL PRIVILEGESEnable Influx authentication
edit
/etc/influxdb.confauth-enabled = trueRestart InfluxDB
docker restart influxdb
Test the connection with administrator user
influx -username 'adminname' -password passwordsupersecure