Install InfluxDB Server and Data Source
We are going to install InfluxDB, the InfluxDB data source, a Telegraf agent and then collect data from some SNMP devices.
InfluxDB is a database useful for storing large amounts of timestamped data.
Telegraf is an agent that supports plugins and it will save it's data into InfluxDB.
Note : The configuration of Grafana, InfluxDB and Telegraf is commonly known on the internet as the TIG stack.
The first part is to Install the InfluxDB service and create the data source in Grafana.
The install commands for your OS are at https://docs.influxdata.com/influxdb/v1.8/introduction/install/
InfluxDB v2.0 is now available. Please install v1.8 since v2.0 is a significantly different process to setup and configure. All the documentation and InfluxDB related videos in this course use InfluxDB v1.8.
I am using Ubuntu 20.04
Check the available InfluxDB version in your apt cache.
It will be the last stable version of InfluxDB
I am going to use a later version 1.8 of InfluxDB, so I will update the apt cache first.
I add the required information to the repository
then update and install
then start the service check it's status is active and ensure it starts in case of reboot and
1 2 3
The InfluxDB will listen on port 8086, and if your server is on the internet, then depending on any existing firewall rules, anybody may be able to query the server using the url
http://[your domain name or ip]:8086/metrics
If you want to prevent direct internet access, then you can use iptables to only allow the port for localhost.
You have other options to secure your InfluxDB as well which are listed at https://docs.influxdata.com/influxdb/v1.8/administration/security/
iptables settings will be lost in case of system reboot. You will need to reapply them manually,
This will save your settings into two files called,
Any changes you make to the iptables configuration won't be auto saved to these persistent files, so if you want to update these files with any changes, then use the commands,
iptables-save > /etc/iptables/rules.v4
iptables-save > /etc/iptables/rules.v6
Next, start the InfluxDB prompt, create a Telegraf database and create a specific read only user for Grafana.
1 2 3 4 5 6 7
It may take several seconds to initially connect to the InfluxDB before you get the prompt
Now continue to add the InfluxDB Data Source as shown in the video.