Install InfluxDB on RHEL / Centos 7

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.

Install InfluxDB on RHEL / Centos 7

The first, You adding InfluxDB repository to your system using the command as below

[vagrant@DevopsRoles ~]$ sudo vi  /etc/yum.repos.d/influxdb.repo

Add the content as 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

Start InfluxDB services on RHEL / Centos 7

[vagrant@DevopsRoles ~]$ sudo systemctl enable influxdb
[vagrant@DevopsRoles ~]$ sudo systemctl start influxdb

To check status InfluxDB is running

[vagrant@DevopsRoles ~]$ sudo systemctl status influxdb

Configure InfluxDB Firewall on RHEL / Centos 7

The default, InfluxDB using TCP port 8086 for client-server communication over HTTP API and TCP port 8088 used for backup and restore.

Open port on the Firewall use 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 as below:

[http]
 auth-enabled = true

Restart 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 running any Influxdb commands on the terminal with specify username and password.

[vagrant@DevopsRoles ~]$ influx -username 'username' -password 'password'

Example curl command use -u option to specify 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 Installed InfluxDB on your system.

, , , ,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

6 thoughts on “Install InfluxDB on RHEL / Centos 7

  1. 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 ~]#

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment moderation is enabled. Your comment may take some time to appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.