How To Install InfluxDB on CentOS 8 / RHEL 8
source link: https://computingforgeeks.com/how-to-install-influxdb-on-rhel-8-centos-8/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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 CentOS 8 | RHEL 8
Influxdata provides the repository for installing InfluxDB on RHEL 8 | CentOS 8. 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/8/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.8.3 Release : 1 Architecture: x86_64 Install Date: Tue 22 Dec 2020 09:22:46 PM UT Group : default Size : 174426402 License : Proprietary Signature : RSA/SHA256, Thu 12 Nov 2020 12:51:46 AM UTC, Key ID 684a14cf2582e0c5 Source RPM : influxdb-1.8.3-1.src.rpm Build Date : Thu 01 Oct 2020 02:11:08 AM UTC Build Host : ca2398100721 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.
$ sudo 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
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK