# Metricbeat can not connect to elastic

**URL:** <https://discuss.elastic.co/t/metricbeat-can-not-connect-to-elastic/160487>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [December 12, 2018, 6:40am UTC](https://discuss.elastic.co/t/metricbeat-can-not-connect-to-elastic/160487 "2018-12-12T06:40:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lujiao](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@lujiao](https://discuss.elastic.co/u/lujiao)\
**Post date:** [December 12, 2018, 6:40am UTC](https://discuss.elastic.co/t/metricbeat-can-not-connect-to-elastic/160487/1 "2018-12-12T06:40:16Z")

</div>

Hello  
I have install elasticsearch and metricbeat,I have config metricbeat’s output to elastic,but when setup meticbeat,  
it’s connect to elasticsearch was refused,the Errors is shown below:

Exiting: Couldn’t connect to any of the configured Elasticsearch hosts. Errors: [Error connection to Elasticsearch [https://10.5.107.22:9200](https://10.5.107.22:9200/): Get [https://10.5.107.22:9200](https://10.5.107.22:9200/): proxyconnect tcp: dial tcp 10.104.1.43:3128: getsockopt: connection refused].  
can anyone help me?thank you very much.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 13, 2018, 8:28am UTC](https://discuss.elastic.co/t/metricbeat-can-not-connect-to-elastic/160487/2 "2018-12-13T08:28:35Z")

</div>

Can you try if you can access the above url with `curl` form the machine you have Metricbeat installed? Do you have a proxy between metricbeat and Elasticsearch?

---

<div class="post-metadata">

**Author:** ![lujiao](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@lujiao](https://discuss.elastic.co/u/lujiao)\
**Post date:** [December 19, 2018, 1:57am UTC](https://discuss.elastic.co/t/metricbeat-can-not-connect-to-elastic/160487/3 "2018-12-19T01:57:03Z")

</div>

Dear ruflin  
I have resolve the problem，the reason is My proxy network server,it refused the connection.the metricbeat and elastic are in the same server,so when I close the proxy,the problem solved.  
Thank you very much.  
Best regards

---

<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:** [January 16, 2019, 1:57am UTC](https://discuss.elastic.co/t/metricbeat-can-not-connect-to-elastic/160487/4 "2019-01-16T01:57:06Z")

</div>

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