I am running Logstash 5.5 in a docker container. Since Logstash API binds to port 9600, i expose the port in the container hoping to access API endpoints from the host. Also, i am running metricbeat on the host to collect logstash stats.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
999b11cdd236 ccur/logstash:latest "/docker-entrypoin..." About an hour ago Up About an hour 0.0.0.0:5044->5044/tcp, 0.0.0.0:9600->9600/tcp, 0.0.0.0:5001->5000/tcp logstash
I am unable to access the api from host. I get the following error from metricbeat
"message": "error making http request: Get http://10.76.144.21:9600/_node/stats: dial tcp 10.76.144.21:9600: getsockopt: connection refused"
Even, a simple curl command fails.
$ curl -XGET '127.0.0.1:9600/_node/stats?pretty'
curl: (56) Recv failure: Connection reset by peer
Any pointers would be appreciated.