Installing InfluxDB OSS

This page provides directions for installing, starting, and configuring InfluxDB open source (OSS).

InfluxDB OSS installation requirements

Installation of the InfluxDB package may require root or administrator privileges in order to complete successfully.

InfluxDB OSS networking ports

By default, InfluxDB uses the following network ports:

  • TCP port 8086 is available for client-server communication using the InfluxDB API.
  • TCP port 8088 is available for the RPC service to perform back up and restore operations.

In addition to the ports above, InfluxDB also offers multiple plugins that mayrequire custom ports.All port mappings can be modified through the configuration file,which is located at /etc/influxdb/influxdb.conf for default installations.

Network Time Protocol (NTP)

InfluxDB uses a host’s local time in UTC to assign timestamps to data and forcoordination purposes.Use the Network Time Protocol (NTP) to synchronize time between hosts; if hosts’clocks aren’t synchronized with NTP, the timestamps on the data written to InfluxDBcan be inaccurate.

Installing InfluxDB OSS

If you want to use InfluxDB but don’t want to install software, check out ourmanaged hosted InfluxDB offering.

Note: Windows support is experimental.

Ubuntu & DebianRed Hat & CentOSSLES & openSUSEFreeBSD/PC-BSDmacOS

For instructions on how to install the Debian package from a file,please see thedownloads page.

Debian and Ubuntu users can install the latest stable version of InfluxDB using theapt-get package manager.

For Ubuntu users, add the InfluxData repository with the following commands:

wgetcurl

  1. wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
  2. source /etc/lsb-release
  3. echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
  1. curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
  2. source /etc/lsb-release
  3. echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

For Debian users, add the InfluxData repository:

wgetcurl

  1. wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
  2. source /etc/os-release
  3. echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
  1. curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
  2. source /etc/os-release
  3. echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

Then, install and start the InfluxDB service:

  1. sudo apt-get update && sudo apt-get install influxdb
  2. sudo service influxdb start

Or if your operating system is using systemd (Ubuntu 15.04+, Debian 8+):

  1. sudo apt-get update && sudo apt-get install influxdb
  2. sudo systemctl unmask influxdb.service
  3. sudo systemctl start influxdb

For instructions on how to install the RPM package from a file, please see the downloads page.

Red Hat and CentOS users can install the latest stable version of InfluxDB using the yum package manager:

  1. cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
  2. [influxdb]
  3. name = InfluxDB Repository - RHEL \$releasever
  4. baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
  5. enabled = 1
  6. gpgcheck = 1
  7. gpgkey = https://repos.influxdata.com/influxdb.key
  8. EOF

Once repository is added to the yum configuration, install and start the InfluxDB service by running:

  1. sudo yum install influxdb
  2. sudo service influxdb start

Or if your operating system is using systemd (CentOS 7+, RHEL 7+):

  1. sudo yum install influxdb
  2. sudo systemctl start influxdb

There are RPM packages provided by openSUSE Build Service for SUSE Linux users:

  1. # add go repository
  2. zypper ar -f obs://devel:languages:go/ go
  3. # install latest influxdb
  4. zypper in influxdb

InfluxDB is part of the FreeBSD package system.It can be installed by running:

  1. sudo pkg install influxdb

The configuration file is located at /usr/local/etc/influxd.conf with examples in /usr/local/etc/influxd.conf.sample.

Start the backend by executing:

  1. sudo service influxd onestart

To have InfluxDB start at system boot, add influxd_enable="YES" to /etc/rc.conf.

Users of macOS 10.8 and higher can install InfluxDB using the Homebrew package manager.Once brew is installed, you can install InfluxDB by running:

  1. brew update
  2. brew install influxdb

To have launchd start InfluxDB at login, run:

  1. ln -sfv /usr/local/opt/influxdb/*.plist ~/Library/LaunchAgents

And then to start InfluxDB now, run:

  1. launchctl load ~/Library/LaunchAgents/homebrew.mxcl.influxdb.plist

Or, if you don’t want/need launchctl, in a separate terminal window you can just run:

  1. influxd -config /usr/local/etc/influxdb.conf

Verify the authenticity of downloaded binary (optional)

For added security, follow these steps to verify the signature of your InfluxDB download with gpg.

(Most operating systems include the gpg command by default.If gpg is not available, see the GnuPG homepage for installation instructions.)

  • Download and import InfluxData’s public key:
  1. curl -sL https://repos.influxdata.com/influxdb.key | gpg --import
  • Download the signature file for the release by adding .asc to the download URL.For example:
  1. wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.10_linux_amd64.tar.gz.asc
  • Verify the signature with gpg —verify:
  1. gpg --verify influxdb-1.7.10_linux_amd64.tar.gz.asc influxdb-1.7.10_linux_amd64.tar.gz

The output from this command should include the following:

  1. gpg: Good signature from "InfluxDB Packaging Service <support@influxdb.com>" [unknown]

Configuring InfluxDB OSS

The system has internal defaults for every configuration file setting.View the default configuration settings with the influxd config command.

Most of the settings in the local configuration file(/etc/influxdb/influxdb.conf) are commented out; allcommented-out settings will be determined by the internal defaults.Any uncommented settings in the local configuration file override theinternal defaults.Note that the local configuration file does not need to include everyconfiguration setting.

There are two ways to launch InfluxDB with your configuration file:

  • Point the process to the correct configuration file by using the -configoption:
  1. influxd -config /etc/influxdb/influxdb.conf
  • Set the environment variable INFLUXDB_CONFIG_PATH to the path of yourconfiguration file and start the process.For example:
  1. echo $INFLUXDB_CONFIG_PATH
  2. /etc/influxdb/influxdb.conf
  3. influxd

InfluxDB first checks for the -config option and then for the environmentvariable.

See the Configuration documentation for more information.

Data and WAL directory permissions

Make sure the directories in which data and the write ahead log (WAL) are stored are writable for the user running the influxd service.

Note: If the data and WAL directories are not writable, the influxd service will not start.

Information about data and wal directory paths is available in the Data settings section of the Configuring InfluxDB documentation.

Hosting InfluxDB OSS on AWS

Hardware requirements for InfluxDB

We recommend using two SSD volumes, using one for the influxdb/wal and the other for the influxdb/data.Depending on your load, each volume should have around 1k-3k provisioned IOPS.The influxdb/data volume should have more disk space with lower IOPS and the influxdb/wal volume should have less disk space with higher IOPS.

Each machine should have a minimum of 8GB RAM.

We’ve seen the best performance with the R4 class of machines, as they provide more memory than either of the C3/C4 class and the M4 class.

Configuring InfluxDB OSS instances

This example assumes that you are using two SSD volumes and that you have mounted them appropriately.This example also assumes that each of those volumes is mounted at /mnt/influx and /mnt/db.For more information on how to do that see the Amazon documentation on how to Add a Volume to Your Instance.

Configuration file

You’ll have to update the configuration file appropriately for each InfluxDB instance you have.

  1. ...
  2. [meta]
  3. dir = "/mnt/db/meta"
  4. ...
  5. ...
  6. [data]
  7. dir = "/mnt/db/data"
  8. ...
  9. wal-dir = "/mnt/influx/wal"
  10. ...
  11. ...
  12. [hinted-handoff]
  13. ...
  14. dir = "/mnt/db/hh"
  15. ...

InfluxDB OSS permissions

When using non-standard directories for InfluxDB data and configurations, also be sure to set filesystem permissions correctly:

  1. chown influxdb:influxdb /mnt/influx
  2. chown influxdb:influxdb /mnt/db

For InfluxDB 1.7.6 or later, you must give owner permissions to the init.sh file. To do this, run the following script in your influxdb directory:

  1. if [ ! -f "$STDOUT" ]; then
  2. mkdir -p $(dirname $STDOUT)
  3. chown $USER:$GROUP $(dirname $STDOUT)
  4. fi
  5. if [ ! -f "$STDERR" ]; then
  6. mkdir -p $(dirname $STDERR)
  7. chown $USER:$GROUP $(dirname $STDERR)
  8. fi
  9. # Override init script variables with DEFAULT values