Hello, im searching how to aproach my case.
I want to influx to setup specified user and create two adittional buckets in order to save telegraf data on docker start
I have this docker compose
version: "3"
services:
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
ports:
- '3000:3000'
volumes:
- ./grafana-provisioning/:/etc/grafana/provisioning
depends_on:
- influxdb
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
influxdb:
image: influxdb:2.0
volumes:
- ./influxdbv2:/root/.influxdbv2
environment:
# Use these same configurations parameters in your telegraf configuration, mytelegraf.conf.
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=TrazastockUser
- DOCKER_INFLUXDB_INIT_PASSWORD=14122004Hol@
- DOCKER_INFLUXDB_INIT_ORG=ceit
- DOCKER_INFLUXDB_INIT_BUCKET=data
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=kUERQvP1fV7Tra0oo1CbaRIsqHgixJS_qgp5H02zmXOq3dtU0s8O-CGCecPMoWMo1riv5hS3WsJHHr
ports:
- "8086:8086"
influxdb_cli:
image: influxdb:2.0
links:
- influxdb
volumes:
# Mount for influxdb data directory and configuration
- ./influxdbv2:/root/.influxdbv2
environment:
# Use these same configurations parameters in your telegraf configuration, mytelegraf.conf
entrypoint: ["./entrypoint.sh"]
restart: on-failure:10
depends_on:
- influxdb
telegraf:
image: telegraf
links:
- influxdb
volumes:
- ./particles.conf:/etc/telegraf/telegraf.conf:ro
- ./Particles:/etc/telegraf/Particles
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- DOCKER_INFLUXDB_INIT_ORG=organization
- DOCKER_INFLUXDB_INIT_BUCKET=bucket1
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=kUERQvP1fV7Tra0oo1CbaRIsqHgixJS_qgp5H02zmXOq3dtU0s8O-CGCecPMoWMo1riv5hS3WsJHHr
depends_on:
- influxdb_cli
telegraf1:
image: telegraf
links:
- influxdb
volumes:
- ./meteorology.conf:/etc/telegraf/telegraf.conf:ro
- ./Meterology:/etc/telegraf/Meterology
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- DOCKER_INFLUXDB_INIT_ORG=organization
- DOCKER_INFLUXDB_INIT_BUCKET=bucket2
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=kUERQvP1fV7Tra0oo1CbaRIsqHgixJS_qgp5H02zmXOq3dtU0s8O-CGCecPMoWMo1riv5hS3WsJHHr5OGPoDrA==
depends_on:
- influxdb_cli
volumes:
influxdb2:
when compose initializes influx starts and run setup succesfully but in the entrypoint script i want to initialize two adittional buckets to save telegraf data.
This is the entrypoint script :
but this script won`t execute and telegraf returns bucket not found
i’ll been searching for a while but i didn`t find any solution
thanks for the help