You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

How can i install InfluxDB on RHEL 8 / CentOS 8?. InfluxDB is an open-source time series database written in Go and optimized for fast, high-availability storage and retrieval of time series data for metrics analysis.

For CentOS 7, Ubuntu and Debian distributions, refer:

Install InfluxDB on Ubuntu 18.04 and Debian 9

Install Grafana and InfluxDB on CentOS 7

Install InfluxDB on RHEL / CentOS 8

Influxdata provides the repository for installing InfluxDB on RHEL 8 / CentOS 8. Since the repository for CentOS 8 is still not available, we will use one for RHEL 7.

Add InfluxDB repository to your system using the commands below:

sudo tee  /etc/yum.repos.d/influxdb.repo<<EOF
[influxdb]
name = InfluxDB Repository
baseurl = https://repos.influxdata.com/rhel/7/x86_64/stable/
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF

Update cache to confirm that the repository is working fine:

sudo dnf makecache

Then install influxDB:

sudo dnf -y install influxdb

Check installed package details.

$ rpm -qi influxdb 
 Name        : influxdb
 Version     : 1.7.8
 Release     : 1
 Architecture: x86_64
 Install Date: Mon 07 Jan 2019 01:37:16 PM EAT
 Group       : default
 Size        : 105943586
 License     : Proprietary
 Signature   : RSA/SHA256, Tue 27 Aug 2019 11:59:21 PM EAT, Key ID 684a14cf2582e0c5
 Source RPM  : influxdb-1.7.8-1.src.rpm
 Build Date  : Wed 21 Aug 2019 05:07:01 AM EAT
 Build Host  : 8d1b307babf6
 Relocations : / 
 Packager    : [email protected]
 Vendor      : InfluxData
 URL         : https://influxdata.com
 Summary     : Distributed time-series database.
 Description :
 Distributed time-series database.

Start InfluxDB Service on RHEL 8 / CentOS 8

Start and enable InfluxDB service on CentOS 8 / RHEL 8:

sudo systemctl enable --now influxdb

Check status to confirm it is running

$ systemctl status influxdb
 ● influxdb.service - InfluxDB is an open-source, distributed, time series database
    Loaded: loaded (/usr/lib/systemd/system/influxdb.service; enabled; vendor preset: disabled)
    Active: active (running) since Tue 2019-09-24 22:12:01 EAT; 23s ago
      Docs: https://docs.influxdata.com/influxdb/
  Main PID: 29345 (influxd)
     Tasks: 8 (limit: 11512)
    Memory: 31.4M
    CGroup: /system.slice/influxdb.service
            └─29345 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
........................................................................

Configure InfluxDB firewall on CentOS 8 / RHEL 8

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.

To open it on the firewall, use the command:

sudo firewall-cmd --add-port=8086/tcp --permanent
sudo firewall-cmd --reload

Port mappings can be modified by changing the file /etc/influxdb/influxdb.conf. 

If you make any change in the configuration file, restart influxdb service.

sudo systemctl restart influxdb

Configure InfluxDB http Authentication

If you need http authentication, modify influxdb http section to contain the following.

$ sudo vi /etc/influxdb/influxdb.conf

[http]
auth-enabled = true

Restart InfluxDB service.

sudo systemctl restart influxdb

Then create a user with an authentication password:

curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE USER \
username WITH PASSWORD 'strongpassword' WITH ALL PRIVILEGES"

Replace:

– username with your own username
– strongpassword with your own password (note that the password requires single quotes)

Now whenever you need to run any influxdb commands on the terminal, you need to specify username using -username and password using -password options.

influx -username 'username' -password 'password'

For curl, use -u to specify username and password separated by a colon.

curl -G http://localhost:8086/query -u username:password --data-urlencode "q=SHOW DATABASES"

By default, influxdb service is listening on all interfaces on port 8086.

$ ss -tunelp | grep 8086
tcp LISTEN 0 128 *:8086 *:* users:(("influxd",pid=2072,fd=5)) uid:985 ino:37787 sk:6 v6only:0 <->

You now have InfluxDB installed on RHEL 8. For usage of InfluxDB, check our guide on:

Monitor Linux System with Grafana and Telegraf

Similar Articles:

Install and Configure Telegraf on RHEL / CentOS 8

How to Install Grafana on RHEL / CentOS 8

How to Install Prometheus on RHEL / CentOS 8

You can support us by downloading this article as PDF from the Link below. Download the guide as PDF