Skip to content

Instantly share code, notes, and snippets.

@GaryRogers
Last active September 24, 2016 15:31
Show Gist options
  • Save GaryRogers/8ccc6a9e711ee229efa6 to your computer and use it in GitHub Desktop.
Save GaryRogers/8ccc6a9e711ee229efa6 to your computer and use it in GitHub Desktop.
Setting up InfluxDB on CentOS/RHEL

Setting up InfluxDB on CentOS/RHEL

The InfluxDB Docs give you a very brief overview of installing InfluxDB on a host. It boils down to 'here's the RPM, install it.' That's fine for looking at the software, but you'll probably want to adjust the configuration a bit for a production environment.

Basic Install

https://influxdb.com/docs/v0.9/introduction/installation.html

Config changes

Modify /etc/opt/influxdb/influxdb.conf

# Disable 'call-home' metrics for InfluxDB. Doesn't make sense behind a firewall
reporting-disabled = true

[data]
  # Move out of var. Make this some place with enough space to hold the database.
  dir = "/opt/influxdb/data"

Making InfluxDB start at boot

chkconfig --add influxdb
service influxdb start

Create Apache Proxy

InfluxDB can do Authentication, but it doesn't appear to be able to do encryption of its traffic. Rather than allowing cleartext Basic-Auth, let's create an Apache Proxy to handle encryption and authentication for us.

# ===================================================================
# Proxy for ElasticSearch access.
# ===================================================================
Listen 8087

<VirtualHost 192.168.1.1:8087>

  CustomLog /local/www/logs/vhosts/influxdb/www.log combined
  ErrorLog  /local/www/logs/vhosts/influxdb/www.err

  <Proxy balancer://main>

    BalancerMember http://127.0.0.1:8086 max=1 retry=5

    <Limit GET POST>
      AuthType Basic
      AuthUserFile /etc/httpd/conf/IFDBUsers
      AuthName "InfluxDB API"

      Order deny,allow
      Require valid-user
      Satisfy All
      Deny from all
      
      Allow from 127.0.0.1
    </Limit>

    <Limit PUT DELETE>
      Order deny,allow
      Deny from all
    </Limit>

  </Proxy>

  ProxyPass / balancer://main/
  ProxyPassReverse / balancer://main/

</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment