Skip to main content

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.conf

Administrator user creation

At this point you need to create an admin account by executing commands within the Docker container

docker exec -en influxdb bash
influx

Within the database console:

CREATE USER adminname WITH PASSWORD 'passwordsupersecure' WITH ALL PRIVILEGES

Enable Influx authentication

  • edit /etc/influxdb.conf

    auth-enabled = true
  • Restart InfluxDB

    docker restart influxdb

Test the connection with administrator user

influx -username 'adminname' -password passwordsupersecure

Get Maximum Efficiency with Docker

Rely on our Docker Support and Consultancy service to optimize your infrastructure. Customized solutions for every business need!

Add new comment

Comment

  • Allowed HTML tags: <br> <p> <code class="language-*"> <pre>
  • Lines and paragraphs break automatically.
  • Only images hosted on this site may be used in <img> tags.