name: influxdb3-ref-network-telemetry services: # One-shot: generate the offline admin token shared by the whole cluster. token-bootstrap: image: influxdb:3-enterprise container_name: nt-token-bootstrap environment: INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info volumes: - influxdb-data:/var/lib/influxdb3 entrypoint: ["sh", "-c"] command: - | if [ ! -s /var/lib/influxdb3/.nt-operator-token ]; then echo "[bootstrap] generating offline admin token" influxdb3 create token --admin --offline \ --name nt-admin \ --output-file /var/lib/influxdb3/.nt-operator-token chmod 600 /var/lib/influxdb3/.nt-operator-token echo "[bootstrap] admin token written" else echo "[bootstrap] admin token already exists, skipping create" fi # Also write a plain-text token alongside the JSON. Healthchecks # read this so /health requests can include the bearer token — # auth is required and 401 is no longer treated as "server is up" # by the healthcheck logic in this version. if [ ! -s /var/lib/influxdb3/.nt-token-plain ]; then sed -n 's/.*"token"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' \ /var/lib/influxdb3/.nt-operator-token | head -n1 \ > /var/lib/influxdb3/.nt-token-plain chmod 600 /var/lib/influxdb3/.nt-token-plain echo "[bootstrap] plain-text token written" fi restart: "no" # ── Ingest tier: 2 nodes, simulator round-robins, plugin write-back targets here ── influxdb3-ingest-1: image: influxdb:3-enterprise container_name: nt-ingest-1 depends_on: token-bootstrap: condition: service_completed_successfully # Wait for nt-query to validate the trial license against the # license server first. Once it succeeds, the license is cached # in the shared influxdb-data volume and every other node reads # it from there — avoids the license-server 500s that happen # when 5 nodes hit the API simultaneously on first boot. influxdb3-query: condition: service_healthy environment: INFLUXDB3_ENTERPRISE_LICENSE_EMAIL: ${INFLUXDB3_ENTERPRISE_EMAIL:?set INFLUXDB3_ENTERPRISE_EMAIL in .env} INFLUXDB3_ENTERPRISE_LICENSE_TYPE: ${INFLUXDB3_ENTERPRISE_LICENSE_TYPE:-trial} INFLUXDB3_NODE_IDENTIFIER_PREFIX: nt-node INFLUXDB3_OBJECT_STORE: file INFLUXDB3_DATA_DIR: /var/lib/influxdb3 INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info command: > serve --node-id nt-ingest-1 --cluster-id nt --mode ingest --object-store file --data-dir /var/lib/influxdb3 --plugin-dir /plugins --virtual-env-location /var/lib/influxdb3/plugin-venv-ingest-1 --admin-token-file /var/lib/influxdb3/.nt-operator-token volumes: - influxdb-data:/var/lib/influxdb3 # All five InfluxDB nodes need access to plugin files because the # shared catalog has registered triggers and every node validates # them at startup. Even ingest/compact nodes (which don't execute # the plugins) need the files present and a per-node Python venv # location, otherwise the engine panics on second-boot. - ./plugins:/plugins:ro healthcheck: test: ["CMD-SHELL", "test -s /var/lib/influxdb3/.nt-token-plain && curl -s --max-time 2 -o /dev/null --fail -H \"Authorization: Bearer $$(cat /var/lib/influxdb3/.nt-token-plain)\" http://127.0.0.1:8181/health"] interval: 5s timeout: 3s retries: 120 start_period: 5s influxdb3-ingest-2: image: influxdb:3-enterprise container_name: nt-ingest-2 depends_on: token-bootstrap: condition: service_completed_successfully influxdb3-query: condition: service_healthy # see ingest-1 comment environment: INFLUXDB3_ENTERPRISE_LICENSE_EMAIL: ${INFLUXDB3_ENTERPRISE_EMAIL:?set INFLUXDB3_ENTERPRISE_EMAIL in .env} INFLUXDB3_ENTERPRISE_LICENSE_TYPE: ${INFLUXDB3_ENTERPRISE_LICENSE_TYPE:-trial} INFLUXDB3_NODE_IDENTIFIER_PREFIX: nt-node INFLUXDB3_OBJECT_STORE: file INFLUXDB3_DATA_DIR: /var/lib/influxdb3 INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info command: > serve --node-id nt-ingest-2 --cluster-id nt --mode ingest --object-store file --data-dir /var/lib/influxdb3 --plugin-dir /plugins --virtual-env-location /var/lib/influxdb3/plugin-venv-ingest-2 --admin-token-file /var/lib/influxdb3/.nt-operator-token volumes: - influxdb-data:/var/lib/influxdb3 - ./plugins:/plugins:ro healthcheck: test: ["CMD-SHELL", "test -s /var/lib/influxdb3/.nt-token-plain && curl -s --max-time 2 -o /dev/null --fail -H \"Authorization: Bearer $$(cat /var/lib/influxdb3/.nt-token-plain)\" http://127.0.0.1:8181/health"] interval: 5s timeout: 3s retries: 120 start_period: 5s # ── Query tier: 1 node, exposed to host on 8181 ── influxdb3-query: image: influxdb:3-enterprise container_name: nt-query depends_on: token-bootstrap: condition: service_completed_successfully environment: INFLUXDB3_ENTERPRISE_LICENSE_EMAIL: ${INFLUXDB3_ENTERPRISE_EMAIL:?set INFLUXDB3_ENTERPRISE_EMAIL in .env} INFLUXDB3_ENTERPRISE_LICENSE_TYPE: ${INFLUXDB3_ENTERPRISE_LICENSE_TYPE:-trial} INFLUXDB3_PLUGIN_DIR: /plugins INFLUXDB3_NODE_IDENTIFIER_PREFIX: nt-node INFLUXDB3_OBJECT_STORE: file INFLUXDB3_DATA_DIR: /var/lib/influxdb3 INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info command: > serve --node-id nt-query --cluster-id nt --mode query --object-store file --data-dir /var/lib/influxdb3 --plugin-dir /plugins --virtual-env-location /var/lib/influxdb3/plugin-venv-query --admin-token-file /var/lib/influxdb3/.nt-operator-token --admin-token-recovery-http-bind 0.0.0.0:8182 volumes: - influxdb-data:/var/lib/influxdb3 - ./plugins:/plugins:ro ports: - "8181:8181" healthcheck: test: ["CMD-SHELL", "test -s /var/lib/influxdb3/.nt-token-plain && curl -s --max-time 2 -o /dev/null --fail -H \"Authorization: Bearer $$(cat /var/lib/influxdb3/.nt-token-plain)\" http://127.0.0.1:8181/health"] interval: 5s timeout: 3s retries: 120 start_period: 5s # ── Compact tier: 1 node, internal only ── influxdb3-compact: image: influxdb:3-enterprise container_name: nt-compact depends_on: token-bootstrap: condition: service_completed_successfully influxdb3-query: condition: service_healthy # see ingest-1 comment environment: INFLUXDB3_ENTERPRISE_LICENSE_EMAIL: ${INFLUXDB3_ENTERPRISE_EMAIL:?set INFLUXDB3_ENTERPRISE_EMAIL in .env} INFLUXDB3_ENTERPRISE_LICENSE_TYPE: ${INFLUXDB3_ENTERPRISE_LICENSE_TYPE:-trial} INFLUXDB3_NODE_IDENTIFIER_PREFIX: nt-node INFLUXDB3_OBJECT_STORE: file INFLUXDB3_DATA_DIR: /var/lib/influxdb3 INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info command: > serve --node-id nt-compact --cluster-id nt --mode compact --object-store file --data-dir /var/lib/influxdb3 --plugin-dir /plugins --virtual-env-location /var/lib/influxdb3/plugin-venv-compact --admin-token-file /var/lib/influxdb3/.nt-operator-token volumes: - influxdb-data:/var/lib/influxdb3 - ./plugins:/plugins:ro healthcheck: test: ["CMD-SHELL", "test -s /var/lib/influxdb3/.nt-token-plain && curl -s --max-time 2 -o /dev/null --fail -H \"Authorization: Bearer $$(cat /var/lib/influxdb3/.nt-token-plain)\" http://127.0.0.1:8181/health"] interval: 5s timeout: 3s retries: 120 start_period: 5s # ── Process tier: 1 node, runs schedule plugins. Mode is process,query # so plugin code can call influxdb3_local.query() against the local # engine. Plugin write-back goes via httpx to ingest-1 (with ingest-2 # fallback) — see plugins/_writeback.py. influxdb3-process: image: influxdb:3-enterprise container_name: nt-process depends_on: token-bootstrap: condition: service_completed_successfully influxdb3-ingest-1: condition: service_healthy environment: INFLUXDB3_ENTERPRISE_LICENSE_EMAIL: ${INFLUXDB3_ENTERPRISE_EMAIL:?set INFLUXDB3_ENTERPRISE_EMAIL in .env} INFLUXDB3_ENTERPRISE_LICENSE_TYPE: ${INFLUXDB3_ENTERPRISE_LICENSE_TYPE:-trial} INFLUXDB3_PLUGIN_DIR: /plugins INFLUXDB3_NODE_IDENTIFIER_PREFIX: nt-node INFLUXDB3_OBJECT_STORE: file INFLUXDB3_DATA_DIR: /var/lib/influxdb3 INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info # Read by schedule plugins for cross-node write-back (see _writeback.py) NT_INGEST_URLS: http://nt-ingest-1:8181,http://nt-ingest-2:8181 NT_DB: nt NT_TOKEN_FILE: /var/lib/influxdb3/.nt-operator-token command: > serve --node-id nt-process --cluster-id nt --mode process,query --object-store file --data-dir /var/lib/influxdb3 --plugin-dir /plugins --virtual-env-location /var/lib/influxdb3/plugin-venv-process --admin-token-file /var/lib/influxdb3/.nt-operator-token volumes: - influxdb-data:/var/lib/influxdb3 - ./plugins:/plugins:ro healthcheck: test: ["CMD-SHELL", "test -s /var/lib/influxdb3/.nt-token-plain && curl -s --max-time 2 -o /dev/null --fail -H \"Authorization: Bearer $$(cat /var/lib/influxdb3/.nt-token-plain)\" http://127.0.0.1:8181/health"] interval: 5s timeout: 3s retries: 120 start_period: 5s # ── Init: one-shot, talks to query node, creates DB/tables/caches/triggers ── influxdb3-init: image: influxdb:3-enterprise container_name: nt-influxdb3-init depends_on: influxdb3-ingest-1: condition: service_healthy influxdb3-ingest-2: condition: service_healthy influxdb3-query: condition: service_healthy influxdb3-compact: condition: service_healthy influxdb3-process: condition: service_healthy environment: INFLUX_HOST: http://nt-query:8181 INFLUX_DB: nt INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info volumes: - influxdb-data:/var/lib/influxdb3 - ./influxdb/init.sh:/usr/local/bin/nt-init.sh:ro - ./plugins:/plugins:ro entrypoint: ["/usr/local/bin/nt-init.sh"] restart: "no" # ── Workload: simulator + UI + scenarios ── simulator: build: context: . dockerfile: simulator/Dockerfile container_name: nt-simulator depends_on: influxdb3-ingest-1: condition: service_healthy influxdb3-ingest-2: condition: service_healthy influxdb3-init: condition: service_completed_successfully environment: SIM_INGEST_URLS: http://nt-ingest-1:8181,http://nt-ingest-2:8181 INFLUX_DB: nt INFLUX_TOKEN_FILE: /tokens/.nt-operator-token SIM_RATE_HZ: ${SIM_RATE_HZ:-1.0} SIM_SEED: ${SIM_SEED:-42} SIM_SPINES: ${SIM_SPINES:-8} SIM_LEAVES: ${SIM_LEAVES:-16} SIM_SERVERS_PER_LEAF: ${SIM_SERVERS_PER_LEAF:-48} SIM_FLOW_RECORDS_PER_SEC: ${SIM_FLOW_RECORDS_PER_SEC:-5000} command: ["python", "-m", "simulator.main"] volumes: - influxdb-data:/tokens:ro ui: build: context: . dockerfile: ui/Dockerfile container_name: nt-ui depends_on: influxdb3-query: condition: service_healthy influxdb3-init: condition: service_completed_successfully environment: INFLUX_URL: http://nt-query:8181 INFLUX_PUBLIC_URL: ${INFLUX_PUBLIC_URL:-http://localhost:8181} INFLUX_DB: nt INFLUX_TOKEN_FILE: /tokens/.nt-operator-token UI_KPI_POLL_MS: ${UI_KPI_POLL_MS:-5000} UI_THROUGHPUT_POLL_MS: ${UI_THROUGHPUT_POLL_MS:-10000} UI_ANOMALIES_POLL_MS: ${UI_ANOMALIES_POLL_MS:-5000} UI_TOP_TALKERS_POLL_MS: ${UI_TOP_TALKERS_POLL_MS:-5000} command: ["uvicorn", "ui.app:app", "--host", "0.0.0.0", "--port", "8080"] ports: - "8080:8080" volumes: - influxdb-data:/tokens:ro scenarios: build: context: . dockerfile: simulator/Dockerfile container_name: nt-scenarios profiles: ["scenarios"] depends_on: influxdb3-ingest-1: condition: service_healthy influxdb3-init: condition: service_completed_successfully environment: SIM_INGEST_URLS: http://nt-ingest-1:8181,http://nt-ingest-2:8181 INFLUX_DB: nt INFLUX_TOKEN_FILE: /tokens/.nt-operator-token SCENARIO: ${SCENARIO:-} volumes: - influxdb-data:/tokens:ro entrypoint: ["sh", "-c", "test -n \"$$SCENARIO\" || { echo 'SCENARIO env var not set' >&2; exit 2; }; exec python -m simulator.scenarios.$$SCENARIO"] restart: "no" volumes: influxdb-data: