(Last Updated On: June 4, 2018)

InfluxDB is an Open Source Time Series Database Platform for storing  Time Series Data, these are metrics & Events collected from different devices. It is a product of InfluxData and part of TICK Stack – which comprises:

T – Telegraf; This is an agent written in Go for collecting performance metrics from the system it’s running on and the services running on that system. The collected metrics are output to InfluxDB or other supported data stores.
IInfluxDB
CChronograf; A web application written in Go and React.js that provides the tools to visualize your monitoring data and easily create alerting and automation rules.
KKapacitor A data processing engine.  It can process both stream and batch data from InfluxDB

In my monitoring series guides, I concentrated on the use of:

  • Telegraf for collecting metrics from systems
  • InfluxDB as Datastore
  • Grafana for metrics visualization

InfluxDB installation for CentOS is available –> Install Grafana and InfluxDB on CentOS 7

Install InfluxDB on Ubuntu 18.04

Installation of InfluxDB on Ubuntu 18.04 is done from Influxdata repository. Once the repo is added, the package can then be installed using an apt package manager. Add the InfluxData repository to the file  /etc/apt/sources.list.d/influxdb.list

$ cat /etc/apt/sources.list.d/influxdb.list
deb https://repos.influxdata.com/ubuntu bionic stable

Import apt key:

$ sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -

Update apt index and install influxdb

$ sudo apt-get update
$ sudo apt-get install influxdb

Start and enable the service to start on boot up.

$ sudo systemctl start influxdb
$ sudo  systemctl enable influxdb
$ sudo systemctl is-enabled influxdb
enabled

Check service status:

$ sudo  systemctl status influxdb
● influxdb.service - InfluxDB is an open-source, distributed, time series database
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: ena
   Active: active (running) since Mon 2018-06-04 15:07:03 UTC; 6s ago
     Docs: https://docs.influxdata.com/influxdb/
 Main PID: 23689 (influxd)
    Tasks: 8 (limit: 4704)
   CGroup: /system.slice/influxdb.service
           └─23689 /usr/bin/influxd -config /etc/influxdb/influxdb.conf

Install InfluxDB on Debian 9

Add influxdata repository using the following command:

$ cat /etc/apt/sources.list.d/influxdb.list
deb https://repos.influxdata.com/debian stretch stable

Import repo gpg key for installing signed packages:

$ sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -

Update apt index and install influxdb package:

$ sudo apt-get update
$ sudo apt-get install influxdb

Start influxdb service:

$ sudo systemctl start influxdb
$ sudo systemctl enable influxdb

You can check the status to confirm if running using:

$ sudo systemctl status influxdb

Open influxdb service ports on the firewall

I use ufw firewall on all my Ubuntu 18.04 and Debian 9 servers. If ufw is not installed, install it using the command:

$ sudo apt-get install ufw

Then activate firewall service:

$ sudo ufw enable

By default, InfluxDB uses the following network ports:

  • TCP port 8086 is used for client-server communication over InfluxDB’s HTTP API
  • TCP port 8088 is used for the RPC service for backup and restore

We will open port 8086 since telegraf will push metrics using this port.

$ sudo ufw allow 8086/tcp

InfluxDB default configuration file is located under /etc/influxdb/influxdb.conf. Most sections are commented out, you can modify it to your liking and restart influxdb service after.