I'm runinng the ELK stack in docker containers (6.4). I have Metricbeat with custom dashboards that i'm mounting into the container. If elasticsearch isn't up, I get the folowing error:
metricbeat_1 | Exiting: Error importing Kibana dashboards: fail to create the Elasticsearch loader: Error creating Elasticsearch client: Couldn't connect to any of the configured Elasticsearch hosts. Errors: [Error connection to Elasticsearch http://elasticsearch:9200: Get http://elasticsearch:9200: dial tcp 172.18.0.2:9200: connect: connection refused]
I'm going to want to use docker-compose to bring up elasticsearch, logstash, kibana, metricbeat, and apm. But the nature of docker-compose is to just bring up all the containers. Is there any way i can make the beats and apm wait for elasticsearch to be up rather than spitting out that error?