Hello, I’m trying to set up a simple telegraf and influxdb instance in a docker network that will capture the default example of system data (ultimately I’d like to capture MQTT). I’ve tried following the official tutorial but I’m a little confused. Running InfluxDB 2.0 and Telegraf Using Docker | InfluxData
Do we need to create docker influxdb instances first to create a config file and save that somewhere before we can use the docker-compose file to work - its a little unclear? I’ve tried to run the docker-compose substituting my username and home directory but leaving all the ./ references the same.
When I run docker-compose up I get the following error:
ERROR: Couldn’t find env file: /home/svl/influxv2.env
How do I create this file - is this a config file I need to build using the initial containers at the beginning of the tutorial?
From what I understand the docker-compose should be a new instance and will define the username, password etc using the CLI? these are then stored as docker environmental variables that will be shared and available to both influxdb and telegraf?
Have I miss understood this tutorial and how it works - also can the system example be added so we can see some data being populated in the running example?
I setup a telegraf/influxdb instance in docker last week with no prior experience. I used the tutorial you mentioned above and also this companion YouTube video which closely follows the tutorial.
In my case, I setup Telegraf standalone and verified it was collecting data and reporting it to stdout. Then I expanded the compose file adding InfluxDB. I decided to hard-code the bucket name, org and token directly into telegraf.conf instead of using the .env and entrypoint.sh stuff in the tutorial. This was partly to keep it simple and partly to discover a minimalist configuration that actually works. So I didn’t include Influx CLI in the compose file and just launched the InFluxDB container and browsed to its UI. That’s where I created an admin account, password, etc and once inside InfluxDB I looked up the auto-generated admin token and pasted that into telegraf.conf. My compose file is as follows: