kibana,elasticsearch 7.2本地设置(无生活连接)

33qvvth1  于 2021-06-13  发布在  ElasticSearch
关注(0)|答案(1)|浏览(356)

elasticsearch:7.2Kibana:7.2
我的docker文件:

app-elasticsearch:
  build: ./docker-elasticsearch
  container_name: elasticsearch
  expose:
  - "9200"
  - "9300"
  ports:
  - "9200:9200"
  - "9300:9300"

app-kibana:
  build: ./docker-kibana
  container_name: kibana
  links:
    - app-elasticsearch
  environment:
    ELASTICSEARCH_URL: "http://app-elasticsearch:9200"
  volumes:
    - ./docker-kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
  expose:
  - "5601"
  ports:
  - "5601:5601"

elasticsearch dockerfile:

FROM docker.elastic.co/elasticsearch/elasticsearch:7.2.0
RUN echo discovery.type: single-node >> /usr/share/elasticsearch/config/elasticsearch.yml

kibana dockerfile公司:

FROM docker.elastic.co/kibana/kibana:7.2.0

kibana配置文件:

server.name: kibana
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]

我检查的时候,elasticsearch似乎工作正常localhost:9200:

curl http://localhost:9200
{
  "name" : "d71d595bd9e6",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "xTdg1O_LRLiiNyO1265XLA",
  "version" : {
    "number" : "7.2.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "508c38a",
    "build_date" : "2019-06-20T15:54:18.811730Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

但kibana日志如下:

{"type":"log","@timestamp":"2020-12-22T02:55:02Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://localhost:9200/"}
kibana               | {"type":"log","@timestamp":"2020-12-22T02:55:02Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}
kibana               | {"type":"log","@timestamp":"2020-12-22T02:55:05Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://localhost:9200/"}
kibana               | {"type":"log","@timestamp":"2020-12-22T02:55:05Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}
kibana               | {"type":"log","@timestamp":"2020-12-22T02:55:05Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://localhost:9200/"}
kibana               | {"type":"log","@timestamp":"2020-12-22T02:55:05Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}
kibana               | {"type":"log","@timestamp":"2020-12-22T02:55:05Z","tags":["warning","task_manager"],"pid":1,"message":"PollError No Living connections"}

请帮助我解决这个问题或任何配置设置ElasticSearch和kibana 7.2欢迎!谢谢

eivnm1vs

eivnm1vs1#

对不起,这完全是我的错。我在docker容器上运行kibana所以 elasticsearch.hosts 应该是[”http://app-elasticsearch:9200"]. 我在docker compose文件中设置了它,但在config文件中也错误地重新定义了它。

server.name: kibana
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://app-elasticsearch:9200"]

这对我有用。

相关问题