In this tutorial, How to install InfluxDB on RHEL / Centos 7. InfluxDB is an open-source time-series database. It is High availability storage and optimized for fast and metrics analysis.
To install InfluxDB on RHEL/CentOS 7, you can follow the steps below:
Table of Contents
Install InfluxDB on RHEL / Centos 7
First, You add InfluxDB repository to your system using the command below
[vagrant@DevopsRoles ~]$ sudo vi /etc/yum.repos.d/influxdb.repo
Add the content below:
[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
Install InfluxDB
[vagrant@DevopsRoles ~]$ sudo yum -y install influxdb
Enable the InfluxDB service to start on system boot:
[vagrant@DevopsRoles ~]$ sudo systemctl enable influxdb
Start InfluxDB services on RHEL / Centos 7
[vagrant@DevopsRoles ~]$ sudo systemctl start influxdb
To check the status of InfluxDB is running
[vagrant@DevopsRoles ~]$ sudo systemctl status influxdb
Configure InfluxDB Firewall on RHEL / Centos 7
The default, InfluxDB uses TCP port 8086 for client-server communication over HTTP API, and TCP port 8088 is used for backup and restore.
Open the port on the Firewall using the command below
[vagrant@DevopsRoles ~]$ sudo firewall-cmd --add-port=8086/tcp --permanent
[vagrant@DevopsRoles ~]$ sudo firewall-cmd --reload
Configure InfluxDB HTTP Authentication on RHEL / Centos 7
Enable HTTP authentication
[vagrant@DevopsRoles ~]$ sudo vi /etc/influxdb/influxdb.conf
Add the content below:
[http]
auth-enabled = true
Restart the InfluxDB service.
[vagrant@DevopsRoles ~]$ sudo systemctl restart influxdb
Create a user with an Authentication password
[vagrant@DevopsRoles ~]$ curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE USER \
username WITH PASSWORD 'password' WITH ALL PRIVILEGES"
You need to run any Influxdb commands on the terminal with a specific username and password.
[vagrant@DevopsRoles ~]$ influx -username 'username' -password 'password'
For example, the curl command uses the -u option to specify a username and password.
[vagrant@DevopsRoles ~]$ curl -G http://localhost:8086/query -u username:password --data-urlencode "q=SHOW DATABASES"
Check Influxdb service is listening
[vagrant@DevopsRoles ~]$ sudo netstat -nplt | grep 8086
You have successfully installed InfluxDB on RHEL/CentOS 7. Thank you for reading the DevopsRoles page!
Your post help me a lot !!! Thanks
Thank your post. I have question. How to Multiple DB Influxdb for Telegraf for Monitoring?
Hi
I tried installing influxdb following the steps. while doing the curl command step, get error as below. Can you please suggest.
# curl -XPOST “http://localhost:8086/query” –data-urlencode “q=CREATE USER \
> influxadmin WITH PASSWORD ‘admin@123’ WITH ALL PRIVILEGES”
html,body{height:100%;padding:0;margin:0;}.oc{display:table;width:100%;height:100%;}.ic{display:table-cell;vertical-align:middle;height:100%;}div.msg{display:block;border:1px solid #30c;padding:0;width:500px;font-family:helvetica,sans-serif;margin:10px auto;}h1{font-weight:bold;color:#fff;font-size:14px;margin:0;padding:2px;text-align:center;background: #30c;}p{font-size:12px;margin:15px auto;width:75%;font-family:helvetica,sans-serif;text-align:left;}504 DNS look up failed504 DNS look up failedThe webserver reported that an error occurred while trying to access the website. Please click here to return to the previous page.
URL: http:// localhost:8086/query
User name:
Group name:
[root@balavm1 ~]#
Hi @bala,
You use:
not
You try it!
Thanks
HuuPV