-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow overriding of configuration parameters using environment variables
This allows all config variable to be set via environment variables using a similar naming convention for the toml config. For example, to change the HTTP API port using the config, you would set: [http] bind-address = ":8086" To change it with an environment variable, you would use: HTTP_BIND_ADDRESS=":8086" influxd The section name is used as the env variable prefix and the config key name is the suffix. The only change to the config name is that "-" should be replaced with "_" to avoid shell interpretation issues. This makes it much easier to configure docker instances within a docker container or adhoc instances at the command-line. For slice config sections like graphite, you can currently only override the first entry since the default config only has 1 entry. To do that use, GRAPHITE_0 as the prefix. You cannot currently add new entries like GRAPHITE_1. A future PR might address this issue. The environment variable values should be the same as the config values. The order that configuration values are applied is as follows: * Default config * Config file * Environment variables * Command-line arguments Fixes #3246
- Loading branch information
Showing
2 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters