influxdata / influxdata/influxdb
Cannot configure multiple graphite listeners via env variables?
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
### Bug report
__System info:__ InfluxDB, version v1.0.2, branch master, commit ff307047057b7797418998a4ed709b0c0f346324. Mac OS X Sierra . Tested locally, also tested on dockerized version of 1.1
__Steps to reproduce:__
1. I need to configure two graphite listeners, one on UDP (port 2004) and other on TCP (port 2003)
2. I set some env variables (not all because lots of them are defaults):
```
INFLUXDB_GRAPHITE_1_ENABLED=true
INFLUXDB_GRAPHITE_1_PROTOCOL=udp
INFLUXDB_GRAPHITE_1_BIND_ADDRESS=:2004
INFLUXDB_GRAPHITE_1_DATABASE=test
INFLUXDB_GRAPHITE_0_PROTOCOL=tcp
INFLUXDB_GRAPHITE_ENABLED=true
```
3. I run `influxd` and in logs I can see
```
...
[httpd] 2016/12/15 11:34:36 Listening on HTTP: [::]:8086
[retention] 2016/12/15 11:34:36 Starting retention policy enforcement service with check interval of 30m0s
[monitor] 2016/12/15 11:34:36 Storing statistics in database '_internal' retention policy 'monitor', at interval 10s
[graphite] 2016/12/15 11:34:36 Starting graphite service, batch size 5000, batch timeout 1s
[monitor] 2016/12/15 11:34:36 'graphite:tcp::2003' registered for diagnostics monitoring
[graphite] 2016/12/15 11:34:36 Listening on TCP: [::]:2003
```
4. If I do it via config file it works
__Expected behavior:__ run two graphite listeners on two ports, which I can set via env variables
__Actual behavior:__ if I set configuration via env variable only one graphite listeners is started (from configuration `INFLUXDB_GRAPHITE_0`)
__Additional info:__ [vars](https://gist.github.com/kklocek/7e762201ef556a08514852cc15638b9f), [stats](https://gist.github.com/kklocek/bf4c953125e0fd60aa882da76e0e53f3), [diagnostics](https://gist.github.com/kklocek/59f1bf6dc5eae9ea9bb5e91a3cbcaa67)
I looked through the docs but I think there is an error there also - on [config](https://docs.influxdata.com/influxdb/v1.1/administration/config/#graphite) I see:
```
Note: To set or override settings in a config section that allows multiple configurations (any section with [[double_brackets]] in the header supports multiple configurations), the desired configuration must be specified by ordinal number. For example, for the first set of [[graphite]] environment variables, prefix the configuration setting name in the environment variable with the relevant position number (in this case: 0):
...
INFLUXDB_GRAPHITE_0_PROTOCOL
...
For the Nth Graphite configuration in the configuration file, the relevant environment variables would be of the form INFLUXDB_GRAPHITE_(N-1)_BATCH_PENDING. For each section of the configuration file the numbering restarts at zero.
```
but in a `graphite` section i see:
```
protocol = “tcp”
Set to tcp or udp.
Environment variable: INFLUXDB_GRAPHITE_PROTOCOL
```
Contributor guide
Research direction
Start with the graphite configuration and environment-variable handling, using the listed INFLUXDB_GRAPHITE_0 and INFLUXDB_GRAPHITE_1 settings as the reproduction. Verify that both the TCP listener on port 2003 and the UDP listener on port 2004 start, and compare the documented variable names with the actual configuration behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100