Elasticsearch服务器未在Windows 10上使用docker运行

时间:2018-03-25 13:36:02

标签: java windows docker elasticsearch docker-compose

我正在跑步"码头组成"在Windows 10计算机上,使用以下yaml:

version: "2"

services:

  myapp:
    build:
      context: .
      dockerfile: ./docker/Dockerfile
    container_name: myapp
    hostname: myapp
    volumes:
      - ../data
    networks:
      - app-test
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - ES_CONNECT_RETRY=120

networks:
  app-test:
    driver: bridge

这应该加载一个elasticsearch服务器。但是我无法到达9300或9200端口,这是我通过运行" docker-compose up":

得到的输出
myapp    | logstash started.
myapp    |  * Starting Kibana5
myapp    |    ...done.
myapp    | ==> /var/log/elasticsearch/elasticsearch.log <==
myapp    | [2018-03-25T13:24:45,348][INFO ][o.e.p.PluginsService     ] [URb4q13] loaded plugin [repository-s3]
myapp    | [2018-03-25T13:24:49,528][INFO ][o.e.d.DiscoveryModule    ] [URb4q13] using discovery type [zen]
myapp    | [2018-03-25T13:24:50,602][INFO ][o.e.n.Node               ] initialized
myapp    | [2018-03-25T13:24:50,603][INFO ][o.e.n.Node               ] [URb4q13] starting ...
myapp    | [2018-03-25T13:24:51,017][INFO ][o.e.t.TransportService   ] [URb4q13] publish_address {172.19.0.2:9300}, bound_addresses {0.0.0.0:9300}
myapp    | [2018-03-25T13:24:51,034][INFO ][o.e.b.BootstrapChecks    ] [URb4q13] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
myapp    | [2018-03-25T13:24:54,215][INFO ][o.e.c.s.ClusterService   ] [URb4q13] new_master {URb4q13}{URb4q13CRrSVhRYf1zWsog}{RM2OGU9GQgeukpJfCR7Wyg}{172.19.0.2}{172.19.0.2:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
myapp    | [2018-03-25T13:24:54,271][INFO ][o.e.h.n.Netty4HttpServerTransport] [URb4q13] publish_address {172.19.0.2:9200}, bound_addresses {0.0.0.0:9200}
myapp    | [2018-03-25T13:24:54,283][INFO ][o.e.n.Node               ] [URb4q13] started
myapp    | [2018-03-25T13:24:54,499][INFO ][o.e.g.GatewayService     ] [URb4q13] recovered [0] indices into cluster_state
myapp    |
myapp    | ==> /var/log/logstash/logstash-plain.log <==
myapp    |
myapp    | ==> /var/log/kibana/kibana5.log <==
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:16Z","tags":["status","plugin:kibana@5.4.1","info"],"pid":186,"state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:17Z","tags":["status","plugin:elasticsearch@5.4.1","info"],"pid":186,"state":"yellow","message":"Status changed from uninitialized to yellow - Waiting for Elasticsearch","prevState":"uninitialized","prevMsg":"uninitialized"}
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:17Z","tags":["status","plugin:console@5.4.1","info"],"pid":186,"state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:17Z","tags":["status","plugin:metrics@5.4.1","info"],"pid":186,"state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:17Z","tags":["status","plugin:timelion@5.4.1","info"],"pid":186,"state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:17Z","tags":["listening","info"],"pid":186,"message":"Server running at http://0.0.0.0:5601"}
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:17Z","tags":["status","ui settings","info"],"pid":186,"state":"yellow","message":"Status changed from uninitialized to yellow - Elasticsearch plugin is yellow","prevState":"uninitialized","prevMsg":"uninitialized"}
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:22Z","tags":["status","plugin:elasticsearch@5.4.1","info"],"pid":186,"state":"yellow","message":"Status changed from yellow to yellow - No existing Kibana index found","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
myapp    |
myapp    | ==> /var/log/elasticsearch/elasticsearch.log <==
myapp    | [2018-03-25T13:25:22,565][INFO ][o.e.c.m.MetaDataCreateIndexService] [URb4q13] [.kibana] creating index, cause [api], templates [], shards [1]/[1], mappings [server, config]
myapp    | [2018-03-25T13:25:23,029][INFO ][o.e.m.j.JvmGcMonitorService] [URb4q13] [gc][32] overhead, spent [366ms] collecting in the last [1s]
myapp    |
myapp    | ==> /var/log/kibana/kibana5.log <==
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:25Z","tags":["status","plugin:elasticsearch@5.4.1","info"],"pid":186,"state":"green","message":"Status changed from yellow to green - Kibana index ready","prevState":"yellow","prevMsg":"No existing Kibana index found"}
myapp    | {"type":"log","@timestamp":"2018-03-25T13:25:25Z","tags":["status","ui settings","info"],"pid":186,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Elasticsearch plugin is yellow"}
myapp    |
myapp    | ==> /var/log/logstash/logstash-plain.log <==
myapp    | [2018-03-25T13:25:53,372][INFO ][logstash.setting.writabledirectory] Creating directory {:setting=>"path.queue", :path=>"/opt/logstash/data/queue"}
myapp    | [2018-03-25T13:25:53,446][INFO ][logstash.agent           ] No persistent UUID file found. Generating new UUID {:uuid=>"4e30a248-d3c7-4e6b-8cad-bbc7aabbb37a", :path=>"/opt/logstash/data/uuid"}
myapp    | [2018-03-25T13:25:57,189][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://localhost:9200/]}}
myapp    | [2018-03-25T13:25:57,204][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://localhost:9200/, :path=>"/"}
myapp    | [2018-03-25T13:25:57,458][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>#<URI::HTTP:0x13238ab4 URL:http://localhost:9200/>}
myapp    | [2018-03-25T13:25:57,469][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>[#<URI::Generic:0x745c7cde URL://localhost>]}
myapp    | [2018-03-25T13:25:58,021][INFO ][logstash.pipeline        ] Starting pipeline {"id"=>"main", "pipeline.workers"=>1, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>125}

任何可能出错的线索?

1 个答案:

答案 0 :(得分:0)

Elasticsearch默认使用 PORT 9200 。只需尝试在9200上访问它.guresearch将9300用于内部集群通信。