HomeDatabaseInstalling InfluxDB on Ubuntu 20.04 LTS Step by Step
Installing InfluxDB on Ubuntu 20.04 LTS Step by Step
On this article we will discuss how to install InfluxDB Open Source (OSS) edition on Ubuntu 20.04 LTS. For this tutorial we are going to use the InfluxDB stable version 1.8.0 Open source edition which is running on single node.
InfluxDB is a time series database (TSDB) which is designed to handle high write and query loads, InfluxDB is developed by InfluxData and written in Go. InfluxDB is meant to be used as a backing store for any use case involving large amounts of timestamped data, including DevOps monitoring, application metrics, Internet of Things sensor data, and real-time analytics.
The initial release of InfluxDB was introduced on 24 September 2013, and the last stable release version is 1.8.0 which was released on 13 April 2020. When the article is written the Preview release for 2.0.0-beta.16 also was released on 7 August 2020.
The key features of InfluxDB 1.8.0 (as mentioned on the InfluxDB official website) are :
Custom high performance datastore written specifically for time series data. The TSM engine allows for high ingest speed and data compression
Written entirely in Go.
It compiles into a single binary with no external dependencies.
Simple, high performing write and query HTTP APIs.
Plugins support for other data ingestion protocols such as Graphite, collectd, and OpenTSDB.
Expressive SQL-like query language tailored to easily query aggregated data.
Tags allow series to be indexed for fast and efficient queries.
Retention policies efficiently auto-expire stale data.
Continuous queries automatically compute aggregate data to make frequent queries more efficient.
InfluxDB Installation Steps
Installation of the InfluxDB package on Ubuntu Linux operating system require root or an ordinary account with sudo privileges, Good internet connection, and sufficient disk space.
InfluxDB Installation Step
1. Add InfluxDB repository
We have to add the InfluxDB repository to our system. For this purpose, just hit, the command line below:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 230 not upgraded.
Need to get 0 B/63.5 MB of archives.
After this operation, 172 MB of additional disk space will be used.
Selecting previously unselected package influxdb.
(Reading database … 224856 files and directories currently installed.)
Preparing to unpack …/influxdb\_1.8.2-1\_amd64.deb …
Unpacking influxdb (1.8.2-1) …
Setting up influxdb (1.8.2-1) …
Created symlink /etc/systemd/system/influxd.service → /lib/systemd/system/influxdb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/influxdb.service → /lib/systemd/system/influxdb.service.
Processing triggers for man-db (2.9.1-1)
3. Verify the authenticity of downloaded binary (optional)
Due to the security reasons, by using gpg command line, we will verify the signature of our InfluxDB. Here are several steps for verifying the installation.
Download and import InfluxData’s public key:
curl -sL https://repos.influxdata.com/influxdb.key | gpg --import
Download the signature file for the release by adding .asc to the download URL. For example:
Verify the signature with gpg –verify:
gpg --verify influxdb-1.8.0_linux_amd64.tar.gz.asc influxdb-1.8.0_linux_a
Checking InfluxDB service, by submitting command line :
ramans@otodiginet:~$ sudo systemctl status influxdb
The local configuration file of InfluxDB is located on /etc/influxdb/influxdb.conf file, we could modify this file if we want to change. We will use this file to launch the InfluxDB on our system. Use the command line below to point the configuration file.
By default, InfluxDB uses the following network ports: TCP port 8086 is used for client-server communication over InfluxDB’s HTTP API and TCP port 8088 is used for the RPC service for backup and restore.
We will enable this ports for external connection to InfluxDB, we will submit command line below :
ramans@otodiginet:~$ sudo ufw enable
Firewall is active and enabled on system startup
ramans@otodiginet:~$ sudo ufw allow 8086/tcp
Rule added (v6)
Connect and Create Database on Influxdb
After the installation and configuration of InfluxDB was done, we will try to connect to InfluxDB and creating a new user and database.
User name : bckinfo Password : stongpassword and Database name : bckinfo_DB
The command line is as follow :
ramans@otodiginet:~$ curl -XPOST "http://localhost:8086/query" \\
--data-urlencode "q=CREATE USER otodiginet WITH PASSWORD 'strongpassword' WITH ALL PRIVILEGES"
ramans@otodiginet:~$ influx -username 'bckinfo' -password 'strongpassword'
Connected to http://localhost:8086 version 1.8.2
InfluxDB shell version: 1.8.2
CREATE DATABASE bckinfo\_DB
So far, we have successfully done install the InfluxDB on Ubuntu 20.04 LTS, and also create user and database on it. As we know InfluxDB is also an integral part of TIG Stack (Telegraf, InfluxDB and Grafana). Drop your comment on comment dialogue box for our improvement.