Guide on how to set up docker, InfluxDB Server and InfluxDB CLient in Raspberry Pi OS
- Sudo apt install docker-io -y && sudo apt install docker-compose -y
- sudo docker run hello-world
- Verification step, hello-world image should be puled and executed.
Steps (3) to (6) are used to configure firewall rules to allow TCP traffic to / from port 8086. Port 8086 is the port used to host the InfluxDB server. This is defined in the docker configuration file (.yml) used below.
- cd to directory containing InfluxDB docker compose configuration file (.yml)
- sudo docker-compose up
- Start services defined in the .yml
- sudo docker ps to verify that container is up and running.
- Perform (3) to (6) if setting up InfluxDB server for the first time.
- sudo apt-get install ufw
- sudo ufw allow 8086/tcp
- sudo ufw enable
- sudo ufw status
- Verification step to ensure firewall rules configured correctly.
- There should be a line that shows 8086/allow in.
- sudo docker ps
- Verify that container is up and running and to obtain IP address of container.
- sudo docker inspect | grep IPAddress
- curl IPAddress:8086 or visit IPAddress:8086 in browser e.g., 172.18.0.2:8086
- user: admin, password: changemeplease
- pip3 install influxdb-client
- Retrieve toekn from InfluxDB Server
- Replace API Token and IP Address in sample read/write codes. Run Simulator.py