InfluxDB

InfluxDB is an open-source time series database (TSDB) developed by InfluxData . It is written in Go and optimized for fast storage and quick availability of time series data in areas such as: operational monitoring, applications for measuring various metrics, storing data received from IoT sensors, and real-time analytics.
InfluxDB has no external dependencies and provides object querying using SQL through port 8086.

Installing InfluxDB server - Debian 9

All commands below are executed by the root user or by a user with administrative rights (for example, using the sudo command).

To begin with, we will download the key:
wget https://repos.influxdata.com/influxdb.key

We install the key:
apt-key add influxdb.key

We create the file with the list where the repository of the files to be installed is located, this time without using an editor, using the command:
echo "deb https://repos.influxdata.com/debian stretch stable" > /etc/apt/sources.list.d/influxdb.list

We perform the update of the package information:
apt update

We install the influxdb server/service:
apt install influxdb

After installation, we check if the service/server is active:
systemctl status influxdb

After we find that the service/server is not running/active, as shown in the image above, we will proceed to start it:
systemctl start influxdb
and to a new check
systemctl status influxdb

so that the service starts automatically with the system boot, we also run the command
systemctl enable influxdb
In order to create new databases and insert data, we will create a new user named telegraf with all privileges.
The name of this user is intentionally chosen to be the same as the service telegraf, a service that will retrieve data from the mqtt server and transfer/write it into the database created in influxdb:
influx -execute "create user "telegraf" with password 'parola' with all privileges;"

We will also create the user grafana with all privileges.
The name of this user is intentionally chosen to be the same as the service grafana, a service that will retrieve data from the influxdb server and transfer it for graphical processing into grafana:
influx -execute "create user "grafana" with password 'parola' with all privileges;"