Metricbeat & docker & kibana dashboard

Hi there, I have a quite interesting question: I am deplyoing an elastic cluster with docker-compose. The problem I could not solve so far: docker-compose starts all containers, also metricbeat. But metricbeat tries to contact kibana in order to push dashboards & templates to elasticsearch. But a beat container is always faster than an elasrticsearch cluster ;-). Metricbeats tells: sorry, noone out there and exits the start. So, is it possible to solve this issue? How do you to this?
Thanks for your input.

PS 'depende_on:' does not help
PPS Here is the metricbeat part I use:

metricbeat:
image: docker.elastic.co/beats/metricbeat:7.7.1
container_name: metricbeat
user: root
environment:
- ELASTICSEARCH_USERNAME={ELASTICSEARCH_USERNAME:-elastic} - ELASTICSEARCH_PASSWORD={ELASTICSEARCH_PASSWORD:-changeme}
- ELASTICSEARCH_HOSTS= "http://esnode1:9200"
command: ["--strict.perms=false"]
depends_on:
- kibana
- esnode1
- esnode2
- esnode3
#kibana:
# condition: service_healthy
networks:
- elasticnet
volumes:
- ./config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- metricbeatlogs:/usr/share/metricbeat/logs

PPPS Error message:
metricbeat | Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to http://kibana:5601/api/status fails: fail to execute the HTTP GET request: Get http://kibana:5601/api/status: dial tcp 172.19.0.7:5601: connect: connection refused. Response: .
metricbeat exited with code 1

Did you try with healthchecks?

No, actually I did not.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.