# Metricbeat Setup not work

**URL:** <https://discuss.elastic.co/t/metricbeat-setup-not-work/142604>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [August 1, 2018, 2:59pm UTC](https://discuss.elastic.co/t/metricbeat-setup-not-work/142604 "2018-08-01T14:59:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyderfs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weyderfs/32/32935_2.png) [@weyderfs](https://discuss.elastic.co/u/weyderfs)\
**Post date:** [August 1, 2018, 2:59pm UTC](https://discuss.elastic.co/t/metricbeat-setup-not-work/142604/1 "2018-08-01T14:59:57Z")

</div>

Hello guys,  
I need help to fix this:

```
mservice@sentinel:~$ sudo metricbeat setup
Exiting: Couldn't connect to any of the configured Elasticsearch hosts. Errors: [Error connection to Elasticsearch http://localhost:5044: Get http://localhost:5044: dial tcp [::1]:5044: getsockopt: connection refused]

```

I think that is the firewall blocking, I'm using Ubuntu Server 18.04 and install ELK via repositories.if it is the firewall, how can I open the ports?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [August 1, 2018, 4:27pm UTC](https://discuss.elastic.co/t/metricbeat-setup-not-work/142604/2 "2018-08-01T16:27:03Z")

</div>

It looks like you have configured it to connect to Elasticsearch on port 5044, but 5044 is normally the Logstash port. Normally Elasticsearch listens on 9200 (http) or 9243 (https).

Or if you intended to send the data to Logstash then double check your configuration to ensure that you have fully removed `output.elasticsearch` and any related config that's under it.

---

<div class="post-metadata">

**Author:** ![weyderfs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weyderfs/32/32935_2.png) [@weyderfs](https://discuss.elastic.co/u/weyderfs)\
**Post date:** [August 1, 2018, 5:15pm UTC](https://discuss.elastic.co/t/metricbeat-setup-not-work/142604/3 "2018-08-01T17:15:05Z")

</div>

@andrewkroh thank you by report I reviewed my metricbeatfile.yml and was set output in both elastic and logstash...

So I try running and:

```
mservice@sentinel:~$ sudo metricbeat setup
Loaded index template
Loading dashboards (Kibana must be running and reachable)
Exiting: Error importing Kibana dashboards: fail to create the Kibana loader: Error creating Kibana client: Error creating Kibana client: can not convert 'object' into 'string' accessing 'setup.kibana.host' (source:'/etc/metricbeat/metricbeat.yml')
```

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [August 1, 2018, 6:18pm UTC](https://discuss.elastic.co/t/metricbeat-setup-not-work/142604/4 "2018-08-01T18:18:48Z")

</div>

That would mean you have an invalid value for `setup.kibana.host` in your configuration file. It needs to be a string.

See [https://www.elastic.co/guide/en/beats/metricbeat/6.3/setup-kibana-endpoint.html](https://www.elastic.co/guide/en/beats/metricbeat/6.3/setup-kibana-endpoint.html) for examples and docs.

---

<div class="post-metadata">

**Author:** ![weyderfs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weyderfs/32/32935_2.png) [@weyderfs](https://discuss.elastic.co/u/weyderfs)\
**Post date:** [August 3, 2018, 5:11pm UTC](https://discuss.elastic.co/t/metricbeat-setup-not-work/142604/5 "2018-08-03T17:11:15Z")

</div>

@andrewkroh thank by feedback, but I already had configured...I change to IP following the tutorial, and the error persists...

---

<div class="post-metadata">

**Author:** ![weyderfs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weyderfs/32/32935_2.png) [@weyderfs](https://discuss.elastic.co/u/weyderfs)\
**Post date:** [August 3, 2018, 5:22pm UTC](https://discuss.elastic.co/t/metricbeat-setup-not-work/142604/6 "2018-08-03T17:22:03Z")

</div>

Currently my firewall it's disable:

```
mservice@sentinel:~$ sudo ufw status
Status: inactive

mservice@sentinel:~$ sudo netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.1.1:5601 0.0.0.0:* LISTEN 6189/node
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6260/nginx: master
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 536/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 798/sshd
tcp6 0 0 192.168.10.128:9200 :::* LISTEN 6113/java
tcp6 0 0 192.168.10.128:9300 :::* LISTEN 6113/java
tcp6 0 0 :::22 :::* LISTEN 798/sshd
```

---

<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:** [August 31, 2018, 5:22pm UTC](https://discuss.elastic.co/t/metricbeat-setup-not-work/142604/7 "2018-08-31T17:22:06Z")

</div>

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