Installation of InfluxDB on Ubuntu22.04|20.04|18.04 is done from Influxdata repository. Once the repo is added, the package can then be installed using an apt package manager. Add the InfluxData repository to the file /etc/apt/sources.list.d/influxdb.list:
Configure a new admin user with root privileges for InfluxDB server.
# start the influx shell and connect to the local InfluxDB instance automatically
influx
# create an admin account
CREATE USER <your_name> WITH PASSWORD '<your_password>' WITH ALL PRIVILEGES
# exit from the InfluxDB shell
quit
Enabling authentication by modifying the main InfluxDB configuration file
sudo nano /etc/influxdb/influxdb.conf
Locate the line # auth-enabled = false under the [http] section.
Change the value of auth-enabled from false to true and remove the leading # symbol from the line to uncomment the setting.
Restart the influxdb service.
sudo systemctl restart influxdb
Creating an InfluxDB Database
Log in to the InfluxDB server with the admin username and password
By default, influxdb service is listening on all interfaces on port 8086.
Install Telegraf
Installation of telegraf on Ubuntu is done from Influxdata repository. Once the repo is added, the package can then be installed using an apt package manager. Add the InfluxData repository to the file /etc/apt/sources.list.d/influxdata.list
cat <<EOF | sudo tee /etc/apt/sources.list.d/influxdata.list
deb https://repos.influxdata.com/ubuntu $(lsb_release -cs) stable
EOF
<node_name> - server-hostname with your valid hostname
<database_name> - database-name with InfluxDB database nae for this host
<grafana_ip> - ip address with Grafana installed
<database_login> - auth-username with InfluxDB http authentication username
<database_password> - auth-password with InfluxDB http authentication password.
Once all changes have been made, you can restart the telegraf service