7 Steps to Install and Configure InfluxDB on Ubuntu 20.04

InfluxDB is a free & open-source database, written in the Go programming language . It is used for storage & retrieve of data such as operations monitoring & application metrics. It is time series database which is used for high write and query loads. It is easy to use.

Step 1 – Update the system.

apt-get update

Step 2 – Install repositories for InfluxDB.

curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
echo "deb https://repos.influxdata.com/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

  • Here is the command output.

Update the packages.

apt-get update

Step 3 – Install Influxdb.

apt-get install influxdb

Step 4 – Start & Enable the Influxdb.

systemctl start influxdb
systemctl enable influxdb

Check the Status of Influxdb.

systemctl status influxdb

Here is the command output.

Step 5 – Configure the Influxdb. Open the influxdb configure file.

vim /etc/influxdb/influxdb.conf

Uncomment the following line:

[http]

enabled = true

Here is the command output.

Restart the influxdb service.

systemctl restart influxdb

Step 6 – Create the InfluxDB account for Admin.

curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE USER influxdbadmin WITH PASSWORD 'password_here' WITH ALL PRIVILEGES"

Login to Influxdb.

influx -username 'admin' -password 'password'

Create Database.

CREATE DATABASE db_name

Exit

Here is the command output.

Run the following command for query on Influxdb.

curl -G http://localhost:8086/query -u ADMIN_NAME:PASSWORD_NAME --data-urlencode "q=QUERY"

Here is the command output.

Create the User for DB.

curl -XPOST "http://localhost:8086/query" \

--data-urlencode "q=CREATE USER user_name WITH PASSWORD 'user_password' WITH ALL PRIVILEGES"

Here is the command output.

Step 7 – Open the port number for Influxdb.

ufw allow 8086/tcp

Here is the command output.

Its Done.

Leave a Reply