Logstash docker fails to connect to Elasticsearch-docker

I am running ELK 6.6.1 docker on my Ubuntu 16.04 host PC. I am trying to run docker for all 4 components - Elasticsearch, logstash, filebeat and kibana.

But logstash docker is not able to connect to elasticsearch docker. It throws following error:
[2019-03-11T14:43:56,784][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://localhost:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://localhost:9200/][Manticore::SocketException] Connection refused (Connection refused)"}

I have tried curl for elasticsearch from host and it works.
But curl from logstash docker instance fails with the following error:
sh-4.2$ curl http://localhost:9200
curl: (7) Failed to connect to ::1: Cannot assign requested address
sh-4.2$

IPv6 is diabled on ubuntu box. My logstash config is quite simple and output looks like following :

output {

I have done the port mapping with host as well i.e. used -p 9200:9200 etc while running docker.

Just FYI. I tried direct instances of all 4 components (without docker) on my host machine and it worked perfectly fine.

Can you please suggest what could be the possible issue in docker configuration here.

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