# Mtericbeat - error - Failed to connect to elasticsearch

**URL:** <https://discuss.elastic.co/t/mtericbeat-error-failed-to-connect-to-elasticsearch/282323>\
**Category:** Beats\
**Created:** [August 24, 2021, 9:22am UTC](https://discuss.elastic.co/t/mtericbeat-error-failed-to-connect-to-elasticsearch/282323 "2021-08-24T09:22:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nehasinha1807](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nehasinha1807](https://discuss.elastic.co/u/nehasinha1807)\
**Post date:** [August 24, 2021, 9:22am UTC](https://discuss.elastic.co/t/mtericbeat-error-failed-to-connect-to-elasticsearch/282323/1 "2021-08-24T09:22:14Z")

</div>

I'm new to ELK. here is my doubt - we had installed ELK lite on a linux server(A) and trying to install metricbeat on a different server(B) but my metricbeat is failed to connect to elasticsearch(A).

1. metricbeat i installed on the same server(A) and it is connected to elasticsearch(A) as well
2. metricbeat on server(B) is getting connected to logstash(A) but fail to connect elasticsearch(A).

metricbeat.yml--\>

```auto
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["sd-vyrg-uptx:9200"]

  # Optional protocol and basic auth credentials.
   protocol: "https"
   username: "username"
   password: "pwd"

```

Please suggest.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 25, 2021, 9:37am UTC](https://discuss.elastic.co/t/mtericbeat-error-failed-to-connect-to-elasticsearch/282323/2 "2021-08-25T09:37:30Z")

</div>

please share errors and logfile excerpts to help debugging. Thanks!

---

<div class="post-metadata">

**Author:** ![nehasinha1807](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nehasinha1807](https://discuss.elastic.co/u/nehasinha1807)\
**Post date:** [August 26, 2021, 4:09pm UTC](https://discuss.elastic.co/t/mtericbeat-error-failed-to-connect-to-elasticsearch/282323/3 "2021-08-26T16:09:09Z")

</div>

Issue resolved. thanks for your reply.

---

<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:** [September 23, 2021, 4:09pm UTC](https://discuss.elastic.co/t/mtericbeat-error-failed-to-connect-to-elasticsearch/282323/4 "2021-09-23T16:09:20Z")

</div>

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