# Beat not waiting for elasticsearch when sending dashboard

**URL:** <https://discuss.elastic.co/t/beat-not-waiting-for-elasticsearch-when-sending-dashboard/147468>\
**Category:** Beats\
**Created:** [September 5, 2018, 8:02pm UTC](https://discuss.elastic.co/t/beat-not-waiting-for-elasticsearch-when-sending-dashboard/147468 "2018-09-05T20:02:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)\
**Post date:** [September 5, 2018, 8:02pm UTC](https://discuss.elastic.co/t/beat-not-waiting-for-elasticsearch-when-sending-dashboard/147468/1 "2018-09-05T20:02:10Z")

</div>

Hi,

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?

Thanks,  
jas

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [September 5, 2018, 10:44pm UTC](https://discuss.elastic.co/t/beat-not-waiting-for-elasticsearch-when-sending-dashboard/147468/2 "2018-09-05T22:44:48Z")

</div>

Hi,

Beats implement a retry mechanism for the output itself, but I'm afraid there is no way to retry the setup process.

If I understand your scenario, you could use some of the ideas proposed here: [https://docs.docker.com/compose/startup-order/](https://docs.docker.com/compose/startup-order/)

You could also configure the scenario to run setup manually after `docker-compose up`, while the beats will start sending data right away, you can deploy the dashboards afterwards.

---

<div class="post-metadata">

**Author:** ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)\
**Post date:** [September 6, 2018, 1:33pm UTC](https://discuss.elastic.co/t/beat-not-waiting-for-elasticsearch-when-sending-dashboard/147468/3 "2018-09-06T13:33:34Z")

</div>

Hi Carlos,

How can I deploy the dashboards afterwards? That might be a solution that works for me.

thanks,  
jas

---

<div class="post-metadata">

**Author:** ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)\
**Post date:** [September 6, 2018, 9:29pm UTC](https://discuss.elastic.co/t/beat-not-waiting-for-elasticsearch-when-sending-dashboard/147468/4 "2018-09-06T21:29:46Z")

</div>

Or, is there a way that I can move load my dashboards when kibana starts? I don't mind moving my dashboard json files to kibana. Is that possible?

thanks,  
Jas

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 4, 2018, 11:29pm UTC](https://discuss.elastic.co/t/beat-not-waiting-for-elasticsearch-when-sending-dashboard/147468/5 "2018-10-04T23:29:46Z")

</div>

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