version: '3'
networks:
elk:
volumes:
elasticsearch:
driver: local
services:
elasticsearch:
environment:
http.host: 0.0.0.0
transport.host: 127.0.0.1
# network.host: 127.0.0.1
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.1
networks:
elk: null
ports:
- 9200:9200
restart: unless-stopped
labels:
traefik.port: 9200
traefik.frontend.rule: "PathPrefixStrip:/elasticsearch"
volumes:
- elasticsearch:/usr/share/elasticsearch/data:rw
logstash:
image: docker.elastic.co/logstash/logstash-oss:6.2.1
depends_on:
- elasticsearch
networks:
elk: null
ports:
- 5044:5044
expose:
- 5044
restart: unless-stopped
labels:
traefik.port: 5044
traefik.frontend.rule: "PathPrefixStrip:/logstash"
volumes:
- ./etc/logstash/pipeline:/usr/share/logstash/pipeline:ro
kibana:
depends_on:
- elasticsearch
environment:
ELASTICSEARCH_PASSWORD: changeme
ELASTICSEARCH_URL: http://127.0.0.1:9200 #http://elasticsearch:9200
ELASTICSEARCH_USERNAME: elastic
image: docker.elastic.co/kibana/kibana-oss:6.2.1
networks:
elk: null
ports:
- 5601:5601
restart: unless-stopped
labels:
traefik.port: 5601
traefik.frontend.rule: "PathPrefixStrip:/kibana"
kibana_1 | {"type":"log","@timestamp":"2018-09-30T09:50:46Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://127.0.0.1:9200/"}
kibana_1 | {"type":"log","@timestamp":"2018-09-30T09:50:46Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}
[2018-09-30T09:54:05,306][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://127.0.0.1:9200/, :path=>"/"}
logstash_1 | [2018-09-30T09:54:05,329][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://127.0.0.1:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://127.0.0.1:9200/][Manticore::SocketException] Connection refused (Connection refused)"}
root@xxx-desktop ~# curl -XGET 'http://127.0.0.1:9200'
{
"name" : "ZR9lm3A",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "gxtM77LHSjOCy-otZeIhOw",
"version" : {
"number" : "6.2.1",
"build_hash" : "7299dc3",
"build_date" : "2018-02-07T19:34:26.990113Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}