<commit_before>---
title: Database Configuration
menu:
  influxdb_1:
    weight: 70
    parent: administration
---

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.

```bash
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.

```bash
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:

    ```bash
    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](/influxdb/v1.0/introduction/installation/#generate-a-configuration-file) 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>
```

Example:

InfluxDB will use `~/mydataz` as the
[data directory](#dir-var-lib-influxdb-data):
```
$ 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

* [Global Options](#global-options)
* [[meta]](#meta)
* [[data]](#data)
* [[coordinator]](#coordinator)
* [[retention]](#retention)
* [[shard-precreation]](#shard-precreation)
* [[admin]](#admin)
* [[monitor]](#monitor)
* [[subscriber]](#subscriber)
* [[http]](#http)
* [[[graphite]]](#graphite)
* [[[collectd]]](#collectd)
* [[[opentsdb]]](#opentsdb)
* [[[udp]]](#udp)
* [[continuous_queries]](#continuous-queries)

## 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](https://github.com/influxdb/influxdb/blob/master/etc/config.sample.toml) 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.  InfluxData does not request, track, or store the IP
addresses of reporting servers.

The `reporting-disabled` option toggles
the reporting of anonymous data every 24 hours to `m.influxdb.com`.
Each report includes a unique, randomly-generated identifier
(an 8-byte Raft ID), OS, architecture, InfluxDB version, and the
number of [databases](/influxdb/v1.0/concepts/glossary/#database),
[measurements](/influxdb/v1.0/concepts/glossary/#measurement), and
unique [series](/influxdb/v1.0/concepts/glossary/#series).  Setting
this option to `true` will disable reporting.

## [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 OS X installations is `/Users/<username>/.influxdb/meta`

### retention-autocreate = true

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](/influxdb/v1.0/concepts/glossary/#database),
[measurements](/influxdb/v1.0/concepts/glossary/#measurement), and
unique [series](/influxdb/v1.0/concepts/glossary/#series).  Setting
this option to `true` will disable reporting.

>**Note:** No data from user databases is ever transmitted.

### default-retention-policy-name = "autogen"

The name of the auto-created retention policy.

### logging-enabled = true

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

### pprof-enabled = false

### lease-duration = "1m0s"

The default duration for leases.

## [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 OS X installations is `/Users/<username>/.influxdb/data`<commit_msg>Update config.md<commit_after>---
title: Database Configuration
menu:
  influxdb_1:
    weight: 70
    parent: administration
---

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.

```bash
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.

```bash
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:

    ```bash
    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](/influxdb/v1.0/introduction/installation/#generate-a-configuration-file) 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>
```

Example:

InfluxDB will use `~/mydataz` as the
[data directory](#dir-var-lib-influxdb-data):
```
$ 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

* [Global Options](#global-options)
* [[meta]](#meta)
* [[data]](#data)
* [[coordinator]](#coordinator)
* [[retention]](#retention)
* [[shard-precreation]](#shard-precreation)
* [[admin]](#admin)
* [[monitor]](#monitor)
* [[subscriber]](#subscriber)
* [[http]](#http)
* [[[graphite]]](#graphite)
* [[[collectd]]](#collectd)
* [[[opentsdb]]](#opentsdb)
* [[[udp]]](#udp)
* [[continuous_queries]](#continuous-queries)

## 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](https://github.com/influxdb/influxdb/blob/master/etc/config.sample.toml) 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](/influxdb/v1.0/concepts/glossary/#database),
[measurements](/influxdb/v1.0/concepts/glossary/#measurement), and
unique [series](/influxdb/v1.0/concepts/glossary/#series).  Setting
this option to `true` will disable reporting.

>**Note:** No data from user databases is ever transmitted.

## [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 OS X installations is `/Users/<username>/.influxdb/meta`

### retention-autocreate = true

Retention policy auto-creation automatically creates a [`DEFAULT` retention policy](/influxdb/v1.0/concepts/glossary/#retention-policy-rp) when a database is created.
The retention policy is 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.

See the next setting to configure the name of the retention policy.

### default-retention-policy-name = "autogen"

The name of the auto-created retention policy.

### logging-enabled = true

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

### pprof-enabled = false

### lease-duration = "1m0s"

The default duration for leases.

## [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 OS X installations is `/Users/<username>/.influxdb/data`
{'fraction_non_alphanumeric': 0.09567617295308188, 'fraction_numerical': 0.0034289537509408713, 'mean_word_length': 4.9969909729187565, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7382998', 'n_tokens_mistral': 3470, 'n_tokens_neox': 3284, 'n_words': 1343}