InfluxDB is an Open Source time series database designed for monitoring metrics and events while providing a real-time visibility into stacks. InfluxDB is a product developed by InfluxData as part of TICK Stack – which comprises of Telegraf, InfluxDB, Chronograf and Kapacitor. It is a fast Go time series database designed for high availability.
InfluxDB can be easily configured using the configuration file (influxdb.conf) and environment variables. Without much theory, let’s dive into the installation of InfluxDB on Debian 10 (Buster) Linux distribution.
Install InfluxDB on Debian 10 (Buster) Linux
Add InfluxDB APT repository.
sudo apt update
sudo apt install -y gnupg2 curl wget
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
echo "deb https://repos.influxdata.com/debian buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
Once the repository is added, install InfluxDB on Debian 10 (Buster) Linux:
sudo apt update
sudo apt install -y influxdb
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.
Start and enable the service to start on boot up.
sudo systemctl enable --now influxdb
Check service status:
~$ systemctl status influxdb ● influxdb.service - InfluxDB is an open-source, distributed, time series database Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2019-10-21 12:59:55 UTC; 1min 33s ago Docs: https://docs.influxdata.com/influxdb/ Main PID: 2088 (influxd) Tasks: 10 (limit: 4719) Memory: 18.0M CGroup: /system.slice/influxdb.service └─2088 /usr/bin/influxd -config /etc/influxdb/influxdb.conf Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458599Z lvl=info msg="Starting precreation service" log_id=0IcbHvDl000 service=shard-pr Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458605Z lvl=info msg="Starting snapshot service" log_id=0IcbHvDl000 service=snapshot Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458610Z lvl=info msg="Starting continuous query service" log_id=0IcbHvDl000 service=con Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458617Z lvl=info msg="Starting HTTP service" log_id=0IcbHvDl000 service=httpd authentic Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458621Z lvl=info msg="opened HTTP access log" log_id=0IcbHvDl000 service=httpd path=std Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458680Z lvl=info msg="Listening on HTTP" log_id=0IcbHvDl000 service=httpd addr=[::]:808 Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458691Z lvl=info msg="Starting retention policy enforcement service" log_id=0IcbHvDl000 Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458876Z lvl=info msg="Listening for signals" log_id=0IcbHvDl000 Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.458968Z lvl=info msg="Storing statistics" log_id=0IcbHvDl000 service=monitor db_instanc Oct 21 12:59:56 deb10 influxd[2088]: ts=2019-10-21T12:59:56.459087Z lvl=info msg="Sending usage statistics to usage.influxdata.com" log_id=0IcbHvDl
Open influxdb service ports on the firewall
For users using ufw firewall, allow service port.
sudo apt -y install ufw sudo ufw enable sudo ufw allow 22/tcp sudo ufw allow 8086/tcp
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
Configure InfluxDB http Authentication (Optional)
If you need http authentication, modify influxdb http section to contain the following.
$ sudo vim /etc/influxdb/influxdb.conf [http] auth-enabled = true
Then create a user with an authentication password:
curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE USER username WITH PASSWORD 'strongpassword' WITH ALL PRIVILEGES"
Replace:
– username with your own username
– strongpassword with your own password (note that the password requires single quotes)
Now whenever you need to run any influxdb commands on the terminal, you need to specify username using -username and password using -password options.
influx -username 'username' -password 'password'
For curl, use -u to specify username and password separated by a colon.
curl -G http://localhost:8086/query -u username:password --data-urlencode "q=SHOW DATABASES"
Enjoy using InfluxDB on Debian 10 (Buster) Linux distribution.
Related guides:
Install InfluxDB on Ubuntu 18.04