# HTTP\_Poller Connection Refused from within a Docker contrainer

**URL:** <https://discuss.elastic.co/t/http-poller-connection-refused-from-within-a-docker-contrainer/76767>\
**Category:** Logstash\
**Created:** [February 28, 2017, 11:11am UTC](https://discuss.elastic.co/t/http-poller-connection-refused-from-within-a-docker-contrainer/76767 "2017-02-28T11:11:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lisadeng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lisadeng/32/15458_2.png) [@lisadeng](https://discuss.elastic.co/u/lisadeng)\
**Post date:** [February 28, 2017, 11:11am UTC](https://discuss.elastic.co/t/http-poller-connection-refused-from-within-a-docker-contrainer/76767/1 "2017-02-28T11:11:13Z")

</div>

I'm really new to the ELK stack and honestly extremely shaky when it comes to understanding concepts like ports, port forwarding and how they relate to Docker and the ELK stack.

I'm currently trying to use HTTP Poller, as specified in this post: [https://www.elastic.co/blog/introducing-logstash-http-poller](https://www.elastic.co/blog/introducing-logstash-http-poller)

to query a website. Following the post, I opened up a port using ruby and sinatra on my local host, and I'm trying to test http poller on it.  
The port is definitely open when I do telnet localhost 8000.

However, on the kibana dashboards all I see are connection refused errors.  
like so: http\_request\_failure.error: Connection refused (Connection refused).

I suspect it has something to do with publishing ports in Docker(I'm using elk-docker).  
I'd like to understand how http poller works with Logstash in the elk-docker container and if I need to specify a specific port or anything like that - it didn't seem to be an option when I read the docs.

---

<div class="post-metadata">

**Author:** ![blissillour](https://avatars.discourse-cdn.com/v4/letter/b/e47774/32.png) [@blissillour](https://discuss.elastic.co/u/blissillour)\
**Post date:** [March 8, 2017, 3:18pm UTC](https://discuss.elastic.co/t/http-poller-connection-refused-from-within-a-docker-contrainer/76767/2 "2017-03-08T15:18:44Z")

</div>

I get the same issue. Did you finally solve it ?

---

<div class="post-metadata">

**Author:** ![lisadeng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lisadeng/32/15458_2.png) [@lisadeng](https://discuss.elastic.co/u/lisadeng)\
**Post date:** [March 13, 2017, 8:25am UTC](https://discuss.elastic.co/t/http-poller-connection-refused-from-within-a-docker-contrainer/76767/3 "2017-03-13T08:25:22Z")

</div>

No, but I think I know why it doesn't work now. I believe the issue is that you'd have to configure the localhost:8000 to an address with 0.0.0.0. Connection Refused means that the port and address is up and running, but not accepting the connection from the Docker Container. Even if the docker is on your localhost, I believe it also has it's own IP address, so when localhost:8000 sees the incoming connection, it refuses it.

I started a flask application on 0.0.0.0:5000 but no luck :/, maybe I"m doing something wrong.  
Regardless, if you use a different website, like google, or anything else, it'll be fine. I used [httpstatu.us](http://httpstatu.us) for testing purposes instead, and there are no errors.  
My guess is that I just don't know how to properly configure my dummy server to accept all incoming connections.

I hope that helps!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 14, 2017, 7:18am UTC](https://discuss.elastic.co/t/http-poller-connection-refused-from-within-a-docker-contrainer/76767/4 "2017-03-14T07:18:28Z")

</div>

What does your http\_poller configuration look like? If it's attempting to connect to localhost:5000 that's probably the reason. Inside your Docker container I don't believe localhost maps to the host's localhost interface. Try connecting to the host's name or IP address.

---

<div class="post-metadata">

**Author:** ![lisadeng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lisadeng/32/15458_2.png) [@lisadeng](https://discuss.elastic.co/u/lisadeng)\
**Post date:** [March 21, 2017, 8:40am UTC](https://discuss.elastic.co/t/http-poller-connection-refused-from-within-a-docker-contrainer/76767/5 "2017-03-21T08:40:04Z")

</div>

That was the issue, thank you!  
I was attempting to connect to 'localhost:5000'

---

<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:** [April 18, 2017, 8:40am UTC](https://discuss.elastic.co/t/http-poller-connection-refused-from-within-a-docker-contrainer/76767/6 "2017-04-18T08:40:05Z")

</div>

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