12.9 C
Texas
angeloma
Senior Writer and partner

How to install InfluxDB on Ubuntu 18.04 and Debian 9?

Normally web servers are very popular among sysadmin. However using the network a lot, you can discover through certain tools, how it improves performance and get statistics about it. The above becomes even more relevant when several systems are required, analyzed and monitored. With this in mind, I will teach you how to install InfluxDB as a first step in measuring your systems.

InfluxDB is a time series database manager, with a primary focus on high availability and the ability to support multiple simultaneous queries. Which makes it ideal for working with graphs, metrics and performance statistics.

Many companies use InfluxDB to store their statistical and event data about what happens with their systems. The main advantage of InfluxDB is that it is open source, so you can examine its source code, in addition, has no external dependencies and thus facilitate its installation.

So, let’s start to install InfluxDB.

0. What you need

- Advertisement -

The installation is not really complicated, however, it is good to keep in mind that it requires a certain level of knowledge about the Linux terminal.

On the other hand, it is necessary that the user can execute commands as the root user. Or, to be the root user.

1. Install InfluxDB on Ubuntu 18.04 and Debian 9

First, upgrade the system. Open a terminal and run:

:~$ sudo apt update && sudo apt upgrade

1.- Upgrade the system
1.- Upgrade the system

It is advisable to do this, to ensure that your system has the latest security patches. These patches will increase the robustness of the system.

An easy way to install InfluxDB on Ubuntu 18.04 and Debian 9 is to add its stable repository. In fact it is the way recommended by its developers.

So, create a new repository file for InfluxDB.

:~$ sudo nano /etc/apt/sources.list.d/influxdb.list

And add this line for Ubuntu:

deb https://repos.influxdata.com/ubuntu bionic stable

And this line, if you use Debian 9.

deb https://repos.influxdata.com/ubuntu stretch stable

2.- Creating the repository file
2.- Creating the repository file

Next, import the GPG key for the repository. Important to make sure the software is signed.

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

3.- Downloading the GPG key
3.- Downloading the GPG key

Then, update APT cache and install InfluxDB.

:~$ sudo apt update && sudo apt install influxdb

4.- Install InfluxDB
4.- Install InfluxDB

Now, enable and start the InfluxDB service.

:~$ sudo systemctl enable influxdb
:~$ sudo systemctl start influxdb

Check the service.

:~$ sudo systemctl status influxdb

5.- Start the InfluxDB service
5.- Start the InfluxDB service

2. Set up the firewall

Normally if you use a server you should have a firewall installed. For this example, I will assume that ufw is installed. If you don’t have it, you can do it with this command:

:~$ sudo apt install ufw

Next, enable it.

:~$ sudo systemctl enable ufw
:~$ sudo systemctl start ufw

6.- Enabling ufw
6.- Enabling ufw

By default, InfluxDB uses TCP ports 8086 and 8088. The 8086 uses it for communication and management while the 8088 is used for backup and data restoration.

So, open these ports on ufw.

:~$ sudo ufw allow 8086/tcp
:~$ sudo ufw allow 8088/tcp

7.- Opening the ports
7.- Opening the ports

3. Test the installation

The best way to test the InfluxDB installation is to create a database. This way we will know if everything has gone well.

So, run in a terminal:

:~$ curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE DATABASE mydb"

8.- Creating a new database
8.- Creating a new database

As you can see, everything went OK.

So, share this post with your friends.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article