Database Configuration

This is archived documentation for InfluxData product versions that are no longer maintained. For newer documentation, see the latest InfluxData documentation.

The InfluxDB configuration file contains configuration settings specific to a local node.

Using Configuration Files

The influxd config command will print out a new TOML-formatted configuration with all the available configuration options set to their default values. On POSIX systems, a new configuration file can be generated by redirecting the output of the command to a file.

influxd config > /etc/influxdb/influxdb.generated.conf

Custom settings from an older configuration file can be preserved when generating a new config file using the -config option.

influxd config -config /etc/influxdb/influxdb.conf.old > /etc/influxdb/influxdb.conf.new

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

  • Point the process to the correct configuration file by using the -config option:

    influxd -config influxdb.generated.conf
  • Set the environment variable INFLUXDB_CONFIG_PATH to the path of your configuration file and start the process. For example:

    echo $INFLUXDB_CONFIG_PATH
    /root/influxdb.generated.conf
    
    influxd
    

InfluxDB first checks for the -config option and then for the environment variable. If you do not supply a configuration file, InfluxDB uses an internal default configuration (equivalent to the output of influxd config). A new configuration file should be generated every time InfluxDB is upgraded.

See the installation documentation for more detail on generating and using configuration files.

Environment variables

Set any configuration option with an environment variable. When the process launches, InfluxDB checks for environment variables of the form below. The environment variable overrides the equivalent option in the configuration file.

INFLUXDB_<CONFIG_SECTION_NAME>_<OPTION_NAME>

To set any configuration that allows multiple configurations (such as collectd, graphite, etc), the system expects them to be prefixed by number. So the first set of graphite environment variables would look like this:

INFLUXDB_GRAPHITE_0_BATCH_PENDING
INFLUXDB_GRAPHITE_0_BATCH_SIZE
INFLUXDB_GRAPHITE_0_BATCH_TIMEOUT
INFLUXDB_GRAPHITE_0_BIND_ADDRESS
INFLUXDB_GRAPHITE_0_CONSISTENCY_LEVEL
INFLUXDB_GRAPHITE_0_DATABASE
INFLUXDB_GRAPHITE_0_ENABLED
INFLUXDB_GRAPHITE_0_PROTOCOL
INFLUXDB_GRAPHITE_0_RETENTION_POLICY
INFLUXDB_GRAPHITE_0_SEPARATOR
INFLUXDB_GRAPHITE_0_TAGS
INFLUXDB_GRAPHITE_0_TEMPLATES
INFLUXDB_GRAPHITE_0_UDP_READ_BUFFER

Current Environment Variables

INFLUXDB_ADMIN_BIND_ADDRESS
INFLUXDB_ADMIN_ENABLED
INFLUXDB_ADMIN_HTTPS_CERTIFICATE
INFLUXDB_ADMIN_HTTPS_ENABLED
INFLUXDB_BIND_ADDRESS
INFLUXDB_COLLECTD_0_BATCH_PENDING
INFLUXDB_COLLECTD_0_BATCH_SIZE
INFLUXDB_COLLECTD_0_BATCH_TIMEOUT
INFLUXDB_COLLECTD_0_BIND_ADDRESS
INFLUXDB_COLLECTD_0_DATABASE
INFLUXDB_COLLECTD_0_ENABLED
INFLUXDB_COLLECTD_0_READ_BUFFER
INFLUXDB_COLLECTD_0_RETENTION_POLICY
INFLUXDB_COLLECTD_0_TYPESDB
INFLUXDB_COLLECTD_BATCH_PENDING
INFLUXDB_COLLECTD_BATCH_SIZE
INFLUXDB_COLLECTD_BATCH_TIMEOUT
INFLUXDB_COLLECTD_BIND_ADDRESS
INFLUXDB_COLLECTD_DATABASE
INFLUXDB_COLLECTD_ENABLED
INFLUXDB_COLLECTD_READ_BUFFER
INFLUXDB_COLLECTD_RETENTION_POLICY
INFLUXDB_COLLECTD_TYPESDB
INFLUXDB_CONTINUOUS_QUERIES
INFLUXDB_CONTINUOUS_QUERIES_ENABLED
INFLUXDB_CONTINUOUS_QUERIES_LOG_ENABLED
INFLUXDB_CONTINUOUS_QUERIES_RUN_INTERVAL
INFLUXDB_COORDINATOR_LOG_QUERIES_AFTER
INFLUXDB_COORDINATOR_MAX_CONCURRENT_QUERIES
INFLUXDB_COORDINATOR_MAX_SELECT_BUCKETS
INFLUXDB_COORDINATOR_MAX_SELECT_POINT
INFLUXDB_COORDINATOR_MAX_SELECT_SERIES
INFLUXDB_COORDINATOR_QUERY_TIMEOUT
INFLUXDB_COORDINATOR_WRITE_TIMEOUT
INFLUXDB_DATA_CACHE_MAX_MEMORY_SIZE
INFLUXDB_DATA_CACHE_SNAPSHOT_MEMORY_SIZE
INFLUXDB_DATA_CACHE_SNAPSHOT_WRITE_COLD_DURATION
INFLUXDB_DATA_COMPACT_FULL_WRITE_COLD_DURATION
INFLUXDB_DATA_DIR
INFLUXDB_DATA_ENGINE
INFLUXDB_DATA_MAX_POINTS_PER_BLOCK
INFLUXDB_DATA_MAX_SERIES_PER_DATABASE
INFLUXDB_DATA_QUERY_LOG_ENABLED
INFLUXDB_DATA_TRACE_LOGGING_ENABLED
INFLUXDB_DATA_WAL_DIR
INFLUXDB_DATA_WAL_LOGGING_ENABLED
INFLUXDB_GRAPHITE_0_BATCH_PENDING
INFLUXDB_GRAPHITE_0_BATCH_SIZE
INFLUXDB_GRAPHITE_0_BATCH_TIMEOUT
INFLUXDB_GRAPHITE_0_BIND_ADDRESS
INFLUXDB_GRAPHITE_0_CONSISTENCY_LEVEL
INFLUXDB_GRAPHITE_0_DATABASE
INFLUXDB_GRAPHITE_0_ENABLED
INFLUXDB_GRAPHITE_0_PROTOCOL
INFLUXDB_GRAPHITE_0_RETENTION_POLICY
INFLUXDB_GRAPHITE_0_SEPARATOR
INFLUXDB_GRAPHITE_0_TAGS
INFLUXDB_GRAPHITE_0_TEMPLATES
INFLUXDB_GRAPHITE_0_UDP_READ_BUFFER
INFLUXDB_GRAPHITE_BATCH_PENDING
INFLUXDB_GRAPHITE_BATCH_SIZE
INFLUXDB_GRAPHITE_BATCH_TIMEOUT
INFLUXDB_GRAPHITE_BIND_ADDRESS
INFLUXDB_GRAPHITE_CONSISTENCY_LEVEL
INFLUXDB_GRAPHITE_DATABASE
INFLUXDB_GRAPHITE_ENABLED
INFLUXDB_GRAPHITE_PROTOCOL
INFLUXDB_GRAPHITE_RETENTION_POLICY
INFLUXDB_GRAPHITE_SEPARATOR
INFLUXDB_GRAPHITE_TAGS
INFLUXDB_GRAPHITE_TEMPLATES
INFLUXDB_GRAPHITE_UDP_READ_BUFFER
INFLUXDB_HTTP_AUTH_ENABLED
INFLUXDB_HTTP_BIND_ADDRESS
INFLUXDB_HTTP_BIND_SOCKET
INFLUXDB_HTTP_ENABLED
INFLUXDB_HTTP_HTTPS_CERTIFICATE
INFLUXDB_HTTP_HTTPS_ENABLED
INFLUXDB_HTTP_HTTPS_PRIVATE_KEY
INFLUXDB_HTTP_LOG_ENABLED
INFLUXDB_HTTP_MAX_CONNECTION_LIMIT
INFLUXDB_HTTP_MAX_ROW_LIMIT
INFLUXDB_HTTP_REALM
INFLUXDB_HTTP_SHARED_SECRET
INFLUXDB_HTTP_UNIX_SOCKET_ENABLED
INFLUXDB_HTTP_WRITE_TRACING
INFLUXDB_META_DIR
INFLUXDB_META_LOGGING_ENABLED
INFLUXDB_META_RETENTION_AUTOCREATE
INFLUXDB_MONITOR_STORE_DATABASE
INFLUXDB_MONITOR_STORE_ENABLED
INFLUXDB_MONITOR_STORE_INTERVAL
INFLUXDB_OPENTSDB_0_BATCH_PENDING
INFLUXDB_OPENTSDB_0_BATCH_SIZE
INFLUXDB_OPENTSDB_0_BATCH_TIMEOUT
INFLUXDB_OPENTSDB_0_BIND_ADDRESS
INFLUXDB_OPENTSDB_0_CERTIFICATE
INFLUXDB_OPENTSDB_0_CONSISTENCY_LEVEL
INFLUXDB_OPENTSDB_0_DATABASE
INFLUXDB_OPENTSDB_0_ENABLED
INFLUXDB_OPENTSDB_0_LOG_POINT_ERRORS
INFLUXDB_OPENTSDB_0_RETENTION_POLICY
INFLUXDB_OPENTSDB_0_TLS_ENABLED
INFLUXDB_OPENTSDB_BATCH_PENDING
INFLUXDB_OPENTSDB_BATCH_SIZE
INFLUXDB_OPENTSDB_BATCH_TIMEOUT
INFLUXDB_OPENTSDB_BIND_ADDRESS
INFLUXDB_OPENTSDB_CERTIFICATE
INFLUXDB_OPENTSDB_CONSISTENCY_LEVEL
INFLUXDB_OPENTSDB_DATABASE
INFLUXDB_OPENTSDB_ENABLED
INFLUXDB_OPENTSDB_LOG_POINT_ERRORS
INFLUXDB_OPENTSDB_RETENTION_POLICY
INFLUXDB_OPENTSDB_TLS_ENABLED
INFLUXDB_REPORTING_DISABLED
INFLUXDB_RETENTION_CHECK_INTERVAL
INFLUXDB_RETENTION_ENABLED
INFLUXDB_SHARD_PRECREATION
INFLUXDB_SHARD_PRECREATION_ADVANCE_PERIOD
INFLUXDB_SHARD_PRECREATION_CHECK_INTERVAL
INFLUXDB_SHARD_PRECREATION_ENABLED
INFLUXDB_SUBSCRIBER_ENABLED
INFLUXDB_SUBSCRIBER_HTTP_TIMEOUT
INFLUXDB_UDP_0_BATCH_PENDING
INFLUXDB_UDP_0_BATCH_SIZE
INFLUXDB_UDP_0_BATCH_TIMEOUT
INFLUXDB_UDP_0_BIND_ADDRESS
INFLUXDB_UDP_0_DATABASE
INFLUXDB_UDP_0_ENABLED
INFLUXDB_UDP_0_PRECISION
INFLUXDB_UDP_0_READ_BUFFER
INFLUXDB_UDP_0_RETENTION_POLICY
INFLUXDB_UDP_BATCH_PENDING
INFLUXDB_UDP_BATCH_SIZE
INFLUXDB_UDP_BATCH_TIMEOUT
INFLUXDB_UDP_BIND_ADDRESS
INFLUXDB_UDP_DATABASE
INFLUXDB_UDP_ENABLED
INFLUXDB_UDP_PRECISION
INFLUXDB_UDP_READ_BUFFER
INFLUXDB_UDP_RETENTION_POLICY

Example:

InfluxDB will use ~/mydataz as the data directory:

$ echo $INFLUXDB_DATA_DIR
~/mydataz

Note: Replace any dashes in option names with underscores. For example, this is the valid environment variable for the store-database option in the [monitor] section:

INFLUXDB_MONITOR_STORE_DATABASE

Configuration Sections

Configuration Options

Every configuration section has configuration options. Every configuration option is optional. If a configuration option is not provided, its default value will be used. All configuration options listed below are set to their default value.

Note: This page documents configuration options for the latest official release - the sample configuration file on GitHub will always be slightly ahead of what is documented here.

Global Options

reporting-disabled = false

InfluxData, the company, relies on reported data from running nodes primarily to track the adoption rates of different InfluxDB versions. This data helps InfluxData support the continuing development of InfluxDB.

The reporting-disabled option toggles the reporting of data every 24 hours to usage.influxdata.com. Each report includes a randomly-generated identifier, OS, architecture, InfluxDB version, and the number of databases, measurements, and unique series. Setting this option to true will disable reporting.

Note: No data from user databases is ever transmitted.

bind-address = “:8088”

This is the port that backup/restore will use.

[meta]

This section controls parameters for InfluxDB’s metastore, which stores information on users, databases, retention policies, shards, and continuous queries.

dir = “/var/lib/influxdb/meta”

The meta directory. Files in the meta directory include meta.db.

Note: The default directory for macOS installations is /Users/<username>/.influxdb/meta

retention-autocreate = true

Retention policy auto-creation automatically creates the DEFAULT retention policy autogen when a database is created. The retention policy autogen has an infinite duration and is also set as the database’s DEFAULT retention policy, which is used when a write or query does not specify a retention policy. Disable this setting to prevent the creation of this retention policy when creating databases.

logging-enabled = true

Meta logging toggles the logging of messages from the meta service.

[data]

This section controls where the actual shard data for InfluxDB lives and how it is flushed from the WAL. dir may need to be changed to a suitable place for you system, but the WAL settings are an advanced configuration. The defaults should work for most systems.

dir = “/var/lib/influxdb/data”

The directory where InfluxDB stores the data. This directory may be changed.

Note: The default directory for macOS installations is /Users/<username>/.influxdb/data

engine = “tsm1”

The storage engine. This is the only option for version 1.0.

wal-dir = “/var/lib/influxdb/wal”

The WAL directory is the location of the write ahead log.

wal-logging-enabled = true

The WAL logging enabled toggles the logging of WAL operations such as WAL flushes to disk.

query-log-enabled = true

The query log enabled setting toggles the logging of parsed queries before execution. Very useful for troubleshooting, but will log any sensitive data contained within a query.

cache-max-memory-size = 524288000

The cache maximum memory size is the maximum size (in bytes) a shard’s cache can reach before it starts rejecting writes.

cache-snapshot-memory-size = 26214400

The cache snapshot memory size is the size at which the engine will snapshot the cache and write it to a TSM file, freeing up memory.

cache-snapshot-write-cold-duration = “1h0m0s”

The cache snapshot write cold duration is the length of time at which the engine will snapshot the cache and write it to a new TSM file if the shard hasn’t received writes or deletes.

compact-full-write-cold-duration = “24h0m0s”

The compact full write cold duration is the duration at which the engine will compact all TSM files in a shard if it hasn’t received a write or delete.

max-points-per-block = 0

The maximum points per block is the maximum number of points in an encoded block in a TSM file. Larger numbers may yield better compression but could incur a performance penalty when querying.

max-series-per-database = 1000000

The maximum number of series allowed per database. The default setting is one million. Change the setting to 0 to allow an unlimited number of series per database.

If a point causes the number of series in a database to exceed max-series-per-database InfluxDB will not write the point, and it returns a 500 with the following error:

{"error":"max series per database exceeded: <series>"}

Note: Any existing databases with a series count that exceeds max-series-per-database will continue to accept writes to existing series, but writes that create a new series will fail.

trace-logging-enabled = false

Toggles logging of additional debug information within the TSM engine and WAL.

[coordinator]

This section contains configuration options for query management. For more on managing queries, see Query Management.

write-timeout = “10s”

The time within which a write request must complete on the cluster.

max-concurrent-queries = 0

The maximum number of running queries allowed on your instance. The default setting (0) allows for an unlimited number of queries.

query-timeout = “0”

The maximum time for which a query can run on your instance before InfluxDB kills the query. The default setting (0) allows queries to run with no time restrictions. This setting is a duration literal.

log-queries-after = “0”

The maximum time a query can run after which InfluxDB logs the query with a Detected slow query message. The default setting ("0") will never tell InfluxDB to log the query. This setting is a duration literal.

max-select-point = 0

The maximum number of points that a SELECT statement can process. The default setting (0) allows the SELECT statement to process an unlimited number of points.

max-select-series = 0

The maximum number of series that a SELECT statement can process. The default setting (0) allows the SELECT statement to process an unlimited number of series.

max-select-buckets = 0

The maximum number of GROUP BY time() buckets that a query can process. The default setting (0) allows a query to process an unlimited number of buckets.

[retention]

This section controls the enforcement of retention policies for evicting old data.

enabled = true

Set to false to prevent InfluxDB from enforcing retention policies.

check-interval = “30m0s”

The rate at which InfluxDB checks to enforce a retention policy.

[shard-precreation]

Controls the precreation of shards so that shards are available before data arrive. Only shards that, after creation, will have both a start- and end-time in the future are ever created. Shards that would be wholly or partially in the past are never precreated.

enabled = true

check-interval = “10m0s”

advance-period = “30m0s”

The maximum period in the future for which InfluxDB precreates shards. The 30m default should work for most systems. Increasing this setting too far in the future can cause inefficiencies.

[admin]

Controls the availability of the built-in, web-based admin interface.

enabled = true

Set to false to disable the admin interface.

bind-address = “:8083”

The port used by the admin interface.

https-enabled = false

Set to true to enable HTTPS for the admin interface.

Note: HTTPS must be enable for the [http] service for the admin UI to function properly using HTTPS.

https-certificate = “/etc/ssl/influxdb.pem”

The path of the certificate file.

[monitor]

This section controls InfluxDB’s system self-monitoring.

By default, InfluxDB writes the data to the _internal database. If that database does not exist, InfluxDB creates it automatically. The DEFAULT retention policy on the _internal database is seven days. If you want to use a retention policy other than the seven-day retention policy, you must create it.

store-enabled = true

Set to false to disable recording statistics internally. If set to false it will make it substantially more difficult to diagnose issues with your installation.

store-database = “_internal”

The destination database for recorded statistics.

store-interval = “10s”

The interval at which InfluxDB records statistics.

[subscriber]

This section controls how Kapacitor will receive data.

enabled = true

Set to false to disable the subscriber service.

http-timeout = “30s”

Controls how long an http request for the subscriber service will run before it times out.

[http]

This section controls how InfluxDB configures the HTTP endpoints. These are the primary mechanisms for getting data into and out of InfluxDB. Edit the options in this section to enable HTTPS and authentication. See Authentication and Authorization.

enabled = true

Set to false to disable HTTP. Note that the InfluxDB command line interface (CLI) connects to the database using the HTTP API.

bind-address = “:8086”

The port used by the HTTP API.

auth-enabled = false

Set to true to require authentication.

log-enabled = true

Set to false to disable logging.

write-tracing = false

Set to true to enable logging for the write payload. If set to true, this will duplicate every write statement in the logs and is thus not recommended for general use.

https-enabled = false

Set to true to enable HTTPS.

https-certificate = “/etc/ssl/influxdb.pem”

The path of the certificate file.

https-private-key = “”

The separate private key location. If only the https-certificate is specified, the httpd service will try to load the private key from the https-certificate file. If a separate https-private-key file is specified, the httpd service will load the private key from the https-private-key file.

max-row-limit = 10000

This limits the number of rows that can be returned in a non-chunked query.

max-connection-limit = 0

Limit the number of connections for the http service. 0 is unlimited.

shared-secret = “”

The shared secret used for JWT signing.

realm = “InfluxDB”

Realm is the JWT realm used by the http endpoint.

[[graphite]]

This section controls one or many listeners for Graphite data. See the README on GitHub for more information.

enabled = false

Set to true to enable Graphite input.

bind-address = “:2003”

The default port.

database = “graphite”

The name of the database that you want to write to.

retention-policy = “”

The relevant retention policy. An empty string is equivalent to the database’s DEFAULT retention policy.

protocol = “tcp”

Set to tcp or udp.

The next three options control how batching works. You should have this enabled otherwise you could get dropped metrics or poor performance. Batching will buffer points in memory if you have many coming in.

batch-size = 5000

The input will flush if this many points get buffered.

batch-pending = 10

The number of batches that may be pending in memory.

batch-timeout = “1s”

The input will flush at least this often even if it hasn’t reached the configured batch-size.

consistency-level = “one”

The number of nodes that must confirm the write. If the requirement is not met the return value will be either partial write if some points in the batch fail or write failure if all points in the batch fail. For more information, see the Query String Parameters for Writes section in the Line Protocol Syntax Reference .

separator = “.”

This string joins multiple matching ‘measurement’ values providing more control over the final measurement name.

udp-read-buffer = 0

UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.

[[collectd]]

This section controls the listener for collectd data. See the README on Github for more information.

enabled = false

Set to true to enable collectd writes.

bind-address = “:25826”

The port.

database = “collectd”

The name of the database that you want to write to. This defaults to collectd.

The next three options control how batching works. You should have this enabled otherwise you could get dropped metrics or poor performance. Batching will buffer points in memory if you have many coming in.

retention-policy = “”

The relevant retention policy. An empty string is equivalent to the database’s DEFAULT retention policy.

batch-size = 5000

The input will flush if this many points get buffered.

batch-pending = 10

The number of batches that may be pending in memory.

batch-timeout = “10s”

The input will flush at least this often even if it hasn’t reached the configured batch-size.

read-buffer = 0

UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.

typesdb = “/usr/share/collectd/types.db”

Defaults to /usr/share/collectd/types.db. A sample types.db file can be found here.

[[opentsdb]]

Controls the listener for OpenTSDB data. See the README on GitHub for more information.

enabled = false

Set to true to enable openTSDB writes.

bind-address = “:4242”

The default port.

database = “opentsdb”

The name of the database that you want to write to. If the database does not exist, it will be created automatically when the input is initialized.

retention-policy = “”

The relevant retention policy. An empty string is equivalent to the database’s DEFAULT retention policy.

consistency-level = “one”

Sets the write consistency level: any, one, quorum, or all for writes.

tls-enabled = false

certificate = “/etc/ssl/influxdb.pem”

The next three options control how batching works. You should have this enabled otherwise you could get dropped metrics or poor performance. Only points metrics received over the telnet protocol undergo batching.

batch-size = 1000

The input will flush if this many points get buffered.

batch-pending = 5

The number of batches that may be pending in memory.

batch-timeout = “1s”

The input will flush at least this often even if it hasn’t reached the configured batch-size.

log-point-errors = true

Log an error for every malformed point.

[[udp]]

This section controls the listeners for InfluxDB line protocol data via UDP. See the UDP page for more information.

enabled = false

Set to true to enable writes over UDP.

bind-address = “:8089”

An empty string is equivalent to 0.0.0.0.

database = “udp”

The name of the database that you want to write to.

retention-policy = “”

The relevant retention policy for your data. An empty string is equivalent to the database’s DEFAULT retention policy.

The next three options control how batching works. You should have this enabled otherwise you could get dropped metrics or poor performance. Batching will buffer points in memory if you have many coming in.

batch-size = 5000

The input will flush if this many points get buffered.

batch-pending = 10

The number of batches that may be pending in memory.

read-buffer = 0

UDP read buffer size, 0 means OS default. UDP listener will fail if set above OS max.

batch-timeout = “1s”

The input will flush at least this often even if it hasn’t reached the configured batch-size.

precision = “”

Time precision used when decoding time values. Defaults to nanoseconds which is the default of the database.

[continuous_queries]

This section controls how continuous queries (CQs) run within InfluxDB. CQs are automated batches of queries that execute over recent time intervals. InfluxDB executes one auto-generated query per GROUP BY time() interval.

log-enabled = true

Set to false to disable logging for CQ events.

enabled = true

Set to false to disable CQs.

run-interval = “1s”

The interval at which InfluxDB checks to see if a CQ needs to run. Set this option to the lowest interval at which your CQs run. For example, if your most frequent CQ runs every minute, set run-interval to 1m.