Hi,
I’m new to docker and containers, I have this docker-compose.yml that configure my stack.
The issue that I’m facing is that InfluxDB it’s not persiting data into ‘/var/lib/influxdb’ in case of a restart/power outage.
Once the container get up and running again, all the data is gone, and I have to create the buckets and the credentials for admin user again.
The other 3 containers on the stack persist data on the same scenario.
Can you advise me on what could be wrong with this .yml file about influxDB configuration?
How do I solve this and get influxDB to persist data?
also, is there a way to save influxDB logs to a volume?
version: '3'
services:
emqx:
image: emqx/emqx
container_name: emqx
networks:
ming_network:
ipv4_address: 172.20.0.2
ports:
- "1883:1883"
- "8083:8083"
- "8883:8883"
- "18083:18083"
environment:
- EMQX_NAME=mybroker
restart: always
volumes:
- emqx_data:/opt/emqx/data
- emqx_log:/opt/emqx/log
- emqx_etc:/opt/emqx/etc
influxdb:
image: influxdb:latest
container_name: influxdb
networks:
ming_network:
ipv4_address: 172.20.0.3
ports:
- "8086:8086"
restart: always
volumes:
- influxdb_data:/var/lib/influxdb
nodered:
image: nodered/node-red
container_name: nodered
networks:
ming_network:
ipv4_address: 172.20.0.4
ports:
- "1880:1880"
restart: always
volumes:
- nodered_data:/data
grafana:
image: grafana/grafana
container_name: grafana
networks:
ming_network:
ipv4_address: 172.20.0.5
ports:
- "3000:3000"
restart: always
volumes:
- grafana_data:/var/lib/grafana
networks:
ming_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/16
volumes:
emqx_data:
emqx_log:
emqx_etc:
influxdb_data:
nodered_data:
grafana_data:
Thanks.