Welcome to our guide on how to install InfluxDB on Ubuntu 22.04|20.04|18.04 Linux system. InfluxDB is an Open Source Time Series Database Platform for storing Time Series Data, these are metrics & Events collected from different devices. It is a product of InfluxData and part of TICK Stack – which comprises:
T – Telegraf; This is an agent written in Go for collecting performance metrics from the system it’s running on and the services running on that system. The collected metrics are output to InfluxDB or other supported data stores.
I – InfluxDB
C – Chronograf; A web application written in Go and React.js that provides the tools to visualize your monitoring data and easily create alerting and automation rules.
K – Kapacitor A data processing engine. It can process both stream and batch data from InfluxDB
In my monitoring series guides, I concentrated on the use of:
- Telegraf for collecting metrics from systems
- InfluxDB as Datastore
- Grafana for metrics visualization
InfluxDB installation for CentOS is available –> Install Grafana and InfluxDB on CentOS 7
Install InfluxDB on Ubuntu 22.04|20.04|18.04
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 :
Before you begin update your system APT repository index.
sudo apt update
Import repository GPG key.
curl -fsSL https://repos.influxdata.com/influxdata-archive_compat.key|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/influxdata.gpg
Then add InfluxDB APT repository.
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
Update apt index and install InfluxDB on Ubuntu 22.04|20.04|18.04:
sudo apt update
sudo apt install influxdb2
Start and enable the service to start on boot up:
sudo systemctl enable --now influxdb
Check service status:
$ systemctl status influxdb
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2023-08-19 09:20:14 UTC; 5s ago
Docs: https://docs.influxdata.com/influxdb/
Process: 9335 ExecStart=/usr/lib/influxdb/scripts/influxd-systemd-start.sh (code=exited, status=0/SUCCESS)
Main PID: 9336 (influxd)
Tasks: 8 (limit: 4523)
Memory: 46.5M
CPU: 625ms
CGroup: /system.slice/influxdb.service
└─9336 /usr/bin/influxd
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9336]: ts=2023-08-19T09:20:14.301686Z lvl=info msg="Open store (end)" log_id=0jkHMyRW000 service=storage-engine service=store op_name=tsdb_open op_eve>
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9336]: ts=2023-08-19T09:20:14.301918Z lvl=info msg="Starting retention policy enforcement service" log_id=0jkHMyRW000 service=retention check_interval>
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9336]: ts=2023-08-19T09:20:14.302172Z lvl=info msg="Starting precreation service" log_id=0jkHMyRW000 service=shard-precreation check_interval=10m adva>
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9336]: ts=2023-08-19T09:20:14.303778Z lvl=info msg="Starting query controller" log_id=0jkHMyRW000 service=storage-reads concurrency_quota=1024 initial>
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9336]: ts=2023-08-19T09:20:14.310436Z lvl=info msg="Configuring InfluxQL statement executor (zeros indicate unlimited)." log_id=0jkHMyRW000 max_select>
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9336]: ts=2023-08-19T09:20:14.319793Z lvl=info msg=Starting log_id=0jkHMyRW000 service=telemetry interval=8h
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9336]: ts=2023-08-19T09:20:14.322095Z lvl=info msg=Listening log_id=0jkHMyRW000 service=tcp-listener transport=http addr=:8086 port=8086
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9359]: Command "print-config" is deprecated, use the influx-cli command server-config to display the configuration values from the running server
Aug 19 09:20:14 jammy influxd-systemd-start.sh[9335]: InfluxDB started
Aug 19 09:20:14 jammy systemd[1]: Started InfluxDB is an open-source, distributed, time series database.
Open influxdb service ports on the firewall
By default, InfluxDB uses the following network ports:
- TCP port 8086 is used for client-server communication over InfluxDB’s HTTP API
- TCP port 8088 is used for the RPC service for backup and restore
If you have UFW service running you’ll need to open port 8086 since telegraf will push metrics using this port.
sudo ufw allow 8086/tcp
InfluxDB default configuration file is located under /etc/influxdb/influxdb.conf. Most sections are commented out, you can modify it to your liking and restart influxdb service after.
Configuring InfluxDB
Run the configuration script.
$ sudo influx setup
> Welcome to InfluxDB 2.0!
? Please type your primary username admin
? Please type your password **********
? Please type your password again **********
? Please type your primary organization name Computingforgeeks
? Please type your primary bucket name mybucket
? Please type your retention period in hours, or 0 for infinite 0
? Setup with these parameters?
Username: admin
Organization: Computingforgeeks
Bucket: mybucket
Retention Period: infinite
Yes
User Organization Bucket
admin Computingforgeeks mybucket
root@jammy:~#
Open your Web browser and go to: http://server_or_hostname:8086
You can browse through the options available in the UI.
Under the “Load Data” section you can get links in how to configure your applications to send data to Telegraf.
Similar guides:
Install InfluxDB CentOS 7 / CentOS 8