mqtt-broker sometimes unhealthy when starting
The mqtt-broker is sometimes "unhealthy" when starting the system e.g. in pipelines. When restarting the pipeline it runs without any problem.
Current settings are:
services:
mqtt-broker:
healthcheck:
test: ["CMD-SHELL", "mosquitto_sub \
-t '$$SYS/broker/version' \
-C 1 \
-u $${MQTT_USER} \
-P $${MQTT_PASSWORD} \
--id docker-compose-healthcheck"]
interval: ${MQTT_BROKER_HEALTHCHECK_INTERVAL}
timeout: 10s
retries: 6
MQTT_BROKER_HEALTHCHECK_INTERVAL
is set by the .env
to 10s.
Maybe it can be solved by just setting the MQTT_BROKER_HEALTHCHECK_INTERVAL
to something larger than 10s or do more retries?
Edited by Joost Hemmen