InfluxDB hitting default port even after override with INFLUXD_HTTP_BIND_ADDRESS
mtsfer opened this issue · 0 comments
mtsfer commented
Problem: InfluxDB keeps hitting default port (8086) even after setting INFLUXD_HTTP_BIND_ADDRESS to another port.
root@0c55ee10f9a1:/# influx config
Active Name URL Org
* default http://localhost:8091 sampleorg
root@0c55ee10f9a1:/# influx auth inactive --id 0cde3cb61839c000
Error: could not find auth with ID "0cde3cb61839c000": Get "http://localhost:8086/api/v2/authorizations/0cde3cb61839c000": dial tcp 127.0.0.1:8086: connect: connection refused
Expected behaviour: UI and API operations should be mapped to address defined using INFLUXD_HTTP_BIND_ADDRESS.
Current configuration:
1) compose.yaml
name: sample-influxdb
services:
influxdb:
image: influxdb:${INFLUXDB_TAG}
container_name: sample-influxdb
restart: unless-stopped
ports:
- "${INFLUXDB_PORT}:${INFLUXDB_PORT}"
environment:
- DOCKER_INFLUXDB_INIT_MODE=${DOCKER_INFLUXDB_INIT_MODE}
- DOCKER_INFLUXDB_INIT_USERNAME_FILE=/run/secrets/admin-username
- DOCKER_INFLUXDB_INIT_PASSWORD_FILE=/run/secrets/admin-password
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE=/run/secrets/admin-token
- DOCKER_INFLUXDB_INIT_ORG=${DOCKER_INFLUXDB_INIT_ORG}
- DOCKER_INFLUXDB_INIT_BUCKET=${DOCKER_INFLUXDB_INIT_BUCKET}
- DOCKER_INFLUXDB_INIT_RETENTION=${DOCKER_INFLUXDB_INIT_RETENTION}
- INFLUXD_HTTP_BIND_ADDRESS=${INFLUXDB_HOST:-}:${INFLUXDB_PORT}
healthcheck:
test: ["CMD", "curl", "-f", "${INFLUXDB_HOST:-localhost}:${INFLUXDB_PORT}/health"]
interval: 30s
timeout: 15s
retries: 10
volumes:
- influxdb-data:/var/lib/influxdb2
- influxdb-config:/etc/influxdb2
- ./config.yaml:/etc/influxdb2/config.yaml
secrets:
- admin-username
- admin-password
- admin-token
volumes:
influxdb-data:
influxdb-config:
secrets:
admin-username:
environment: DOCKER_INFLUXDB_INIT_USERNAME
admin-password:
environment: DOCKER_INFLUXDB_INIT_PASSWORD
admin-token:
environment: DOCKER_INFLUXDB_INIT_ADMIN_TOKEN
2) .env
INFLUXDB_TAG=2.7.5
# InfluxDB will be accessible at http://localhost:8091
# INFLUXDB_HOST=example-domain
INFLUXDB_PORT=8091
DOCKER_INFLUXDB_INIT_MODE=setup
DOCKER_INFLUXDB_INIT_USERNAME=sampleuser
DOCKER_INFLUXDB_INIT_PASSWORD=samplepass123
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=sampletoken123
DOCKER_INFLUXDB_INIT_ORG=sampleorg
DOCKER_INFLUXDB_INIT_BUCKET=samplebucket
DOCKER_INFLUXDB_INIT_RETENTION=30d
3) config.yaml
bolt-path: /var/lib/influxdb2/influxd.bolt
engine-path: /var/lib/influxdb2/engine
Logs generated by docker compose up
:
[+] Running 3/3
✔ Volume "sample-influxdb_influxdb-data" Created 0.0s
✔ Volume "sample-influxdb_influxdb-config" Created 0.0s
✔ Container sample-influxdb Created 0.2s
Attaching to sample-influxdb
sample-influxdb | {
sample-influxdb | "bolt-path": "/var/lib/influxdb2/influxd.bolt",
sample-influxdb | "engine-path": "/var/lib/influxdb2/engine",
sample-influxdb | "http-bind-address": ":9999"
sample-influxdb | }
sample-influxdb | 2024-04-10T17:01:51.991146958Z info booting influxd server in the background {"system": "docker"}
sample-influxdb | ts=2024-04-10T17:01:52.124999Z lvl=info msg="Welcome to InfluxDB" log_id=0oUFBKV0000 version=v2.7.5 commit=09a9607fd9 build_date=2024-01-05T17:17:04Z log_level=info
sample-influxdb | ts=2024-04-10T17:01:52.139303Z lvl=info msg="Resources opened" log_id=0oUFBKV0000 service=bolt path=/var/lib/influxdb2/influxd.bolt
sample-influxdb | ts=2024-04-10T17:01:52.139411Z lvl=info msg="Resources opened" log_id=0oUFBKV0000 service=sqlite path=/var/lib/influxdb2/influxd.sqlite
sample-influxdb | ts=2024-04-10T17:01:52.141241Z lvl=info msg="Bringing up metadata migrations" log_id=0oUFBKV0000 service="KV migrations" migration_count=20
sample-influxdb | ts=2024-04-10T17:01:52.296642Z lvl=info msg="Bringing up metadata migrations" log_id=0oUFBKV0000 service="SQL migrations" migration_count=8
sample-influxdb | ts=2024-04-10T17:01:52.335970Z lvl=info msg="Using data dir" log_id=0oUFBKV0000 service=storage-engine service=store path=/var/lib/influxdb2/engine/data
sample-influxdb | ts=2024-04-10T17:01:52.336053Z lvl=info msg="Compaction settings" log_id=0oUFBKV0000 service=storage-engine service=store max_concurrent_compactions=4 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
sample-influxdb | ts=2024-04-10T17:01:52.336063Z lvl=info msg="Open store (start)" log_id=0oUFBKV0000 service=storage-engine service=store op_name=tsdb_open op_event=start
sample-influxdb | ts=2024-04-10T17:01:52.336119Z lvl=info msg="Open store (end)" log_id=0oUFBKV0000 service=storage-engine service=store op_name=tsdb_open op_event=end op_elapsed=0.057ms
sample-influxdb | ts=2024-04-10T17:01:52.336148Z lvl=info msg="Starting retention policy enforcement service" log_id=0oUFBKV0000 service=retention check_interval=30m
sample-influxdb | ts=2024-04-10T17:01:52.336168Z lvl=info msg="Starting precreation service" log_id=0oUFBKV0000 service=shard-precreation check_interval=10m advance_period=30m
sample-influxdb | ts=2024-04-10T17:01:52.336983Z lvl=info msg="Starting query controller" log_id=0oUFBKV0000 service=storage-reads concurrency_quota=1024 initial_memory_bytes_quota_per_query=9223372036854775807 memory_bytes_quota_per_query=9223372036854775807 max_memory_bytes=0 queue_size=1024
sample-influxdb | ts=2024-04-10T17:01:52.340006Z lvl=info msg="Configuring InfluxQL statement executor (zeros indicate unlimited)." log_id=0oUFBKV0000 max_select_point=0 max_select_series=0 max_select_buckets=0
sample-influxdb | ts=2024-04-10T17:01:52.348683Z lvl=info msg=Starting log_id=0oUFBKV0000 service=telemetry interval=8h
sample-influxdb | ts=2024-04-10T17:01:52.349645Z lvl=info msg=Listening log_id=0oUFBKV0000 service=tcp-listener transport=http addr=:9999 port=9999
sample-influxdb | 2024-04-10T17:01:52.996226308Z info pinging influxd... {"system": "docker", "ping_attempt": "0"}
sample-influxdb | 2024-04-10T17:01:53.016736242Z info got response from influxd, proceeding {"system": "docker", "total_pings": "1"}
sample-influxdb | User Organization Bucket
sample-influxdb | sampleuser sampleorg samplebucket
sample-influxdb | 2024-04-10T17:01:53.165645245Z info Executing user-provided scripts {"system": "docker", "script_dir": "/docker-entrypoint-initdb.d"}
sample-influxdb | 2024-04-10T17:01:53.168668582Z info initialization complete, shutting down background influxd {"system": "docker"}
sample-influxdb | 2024-04-10T17:01:53.306214018Z info found existing boltdb file, skipping setup wrapper {"system": "docker", "bolt_path": "/var/lib/influxdb2/influxd.bolt"}
sample-influxdb | ts=2024-04-10T17:01:53.487852Z lvl=info msg="Welcome to InfluxDB" log_id=0oUFBPol000 version=v2.7.5 commit=09a9607fd9 build_date=2024-01-05T17:17:04Z log_level=info
sample-influxdb | ts=2024-04-10T17:01:53.500595Z lvl=info msg="Resources opened" log_id=0oUFBPol000 service=bolt path=/var/lib/influxdb2/influxd.bolt
sample-influxdb | ts=2024-04-10T17:01:53.500785Z lvl=info msg="Resources opened" log_id=0oUFBPol000 service=sqlite path=/var/lib/influxdb2/influxd.sqlite
sample-influxdb | ts=2024-04-10T17:01:53.506666Z lvl=info msg="Checking InfluxDB metadata for prior version." log_id=0oUFBPol000 bolt_path=/var/lib/influxdb2/influxd.bolt
sample-influxdb | ts=2024-04-10T17:01:53.506763Z lvl=info msg="Using data dir" log_id=0oUFBPol000 service=storage-engine service=store path=/var/lib/influxdb2/engine/data
sample-influxdb | ts=2024-04-10T17:01:53.506781Z lvl=info msg="Compaction settings" log_id=0oUFBPol000 service=storage-engine service=store max_concurrent_compactions=4 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
sample-influxdb | ts=2024-04-10T17:01:53.506789Z lvl=info msg="Open store (start)" log_id=0oUFBPol000 service=storage-engine service=store op_name=tsdb_open op_event=start
sample-influxdb | ts=2024-04-10T17:01:53.506844Z lvl=info msg="Open store (end)" log_id=0oUFBPol000 service=storage-engine service=store op_name=tsdb_open op_event=end op_elapsed=0.056ms
sample-influxdb | ts=2024-04-10T17:01:53.506883Z lvl=info msg="Starting retention policy enforcement service" log_id=0oUFBPol000 service=retention check_interval=30m
sample-influxdb | ts=2024-04-10T17:01:53.506903Z lvl=info msg="Starting precreation service" log_id=0oUFBPol000 service=shard-precreation check_interval=10m advance_period=30m
sample-influxdb | ts=2024-04-10T17:01:53.507641Z lvl=info msg="Starting query controller" log_id=0oUFBPol000 service=storage-reads concurrency_quota=1024 initial_memory_bytes_quota_per_query=9223372036854775807 memory_bytes_quota_per_query=9223372036854775807 max_memory_bytes=0 queue_size=1024
sample-influxdb | ts=2024-04-10T17:01:53.510848Z lvl=info msg="Configuring InfluxQL statement executor (zeros indicate unlimited)." log_id=0oUFBPol000 max_select_point=0 max_select_series=0 max_select_buckets=0
sample-influxdb | ts=2024-04-10T17:01:53.520332Z lvl=info msg=Starting log_id=0oUFBPol000 service=telemetry interval=8h
sample-influxdb | ts=2024-04-10T17:01:53.520618Z lvl=info msg=Listening log_id=0oUFBPol000 service=tcp-listener transport=http addr=:8091 port=8091