在Windows中启动Kibana时如何解决错误“无活动连接”

时间:2019-09-01 13:50:58

标签: elasticsearch kibana elk kibana-7

我刚刚开始学习ELK堆栈。我指的是这个网站 https://www.elastic.co/guide/en/elastic-stack-get-started/6.4/get-started-elastic-stack.html 在系统中安装ELK堆栈时,当我尝试在Windows系统中启动Kibana时遇到问题。我收到以下错误

\log   [13:36:52.255] [warning][admin][elasticsearch] Unable to revive connection: http://localhost:9200/                
log   [13:36:52.277] [warning][admin][elasticsearch] No living connections  
log   [13:36:52.279] [warning][task_manager] PollError No Living connections                                            
log   [13:36:53.810] [warning][admin][elasticsearch] Unable to revive connection: http://localhost:9200/
log   [13:36:53.836] [warning][admin][elasticsearch] No living connections                                              
log   [13:36:56.456] [warning][admin][elasticsearch] Unable to revive connection: http://localhost:9200/  
log   [13:36:56.457] [warning][admin][elasticsearch] No living connections                                              
log   [13:36:56.458] [warning][task_manager] PollError No Living connections 
log   [13:36:57.348] [warning][admin][elasticsearch] Unable to revive connection: http://localhost:9200/                
log   [13:36:57.349] [warning][admin][elasticsearch] No living connections 

我认为获取弹性搜索连接存在问题。但我认为弹性搜索实例已成功启动。当我跑步时

./bin/elasticsearch.bat

我得到以下结果

[2019-09-01T18:34:11,594][INFO ][o.e.h.AbstractHttpServerTransport] [DESKTOP-TD85D7S] publish_address {192.168.0.101:9200}, bound_addresses {192.168.99.1:9200}, {192.168.56.1:9200}, {192.168.0.101:9200}   
[2019-09-01T18:34:11,595][INFO ][o.e.n.Node               ] [DESKTOP-TD85D7S] started 

我不知道这种情况下的问题是什么。有人帮我解决这个问题会很棒

预先感谢

2 个答案:

答案 0 :(得分:2)

在您的kibana.yml配置文件中,您需要更改以下行:

elasticsearch.hosts: ["http://localhost:9200"]

elasticsearch.hosts: ["http://192.168.0.101:9200"]

答案 1 :(得分:0)

注意:Elasticsearch 7.4.0、Kibana 7.4.0

状态:工作。

我正在使用 docker-compose.yml 文件在本地主机上运行 elasticsearch 和 kibana。端口 9200 正在被另一个服务使用,所以我已经映射了 9201:9200(本地主机的 9201 与 docker 容器的 9200)

在 kibana 环境变量中,我们正在设置 elasticsearch 主机和端口(端口应该是容器端口),例如。 ELASTICSEARCH_HOSTS=http://elasticsearch:9200

文件:docker-compose.yml

version: '3.7'

services:

  # Elasticsearch 
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
    container_name: elasticsearch
    environment:
      - xpack.security.enabled=false
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    cap_add:
      - IPC_LOCK
    volumes:
      - elasticsearch-data:/usr/share/elasticsearch/data
    ports:
      - 9201:9200
      - 9300:9300

  # Kibana
  kibana:
    container_name: kibana
    image: docker.elastic.co/kibana/kibana:7.4.0
    environment:
      - ELASTICSEARCH_HOSTS=http://elasticsearch:9200
    ports:
      - 5601:5601
    depends_on:
      - elasticsearch

volumes:
  elasticsearch-data:
    driver: local

Elastic search 在 http://localhost:9201 运行,你会得到类似

{
  "name" : "d0bb78764b7e",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "Djch5nbnSWC-EqYawp2Cng",
  "version" : {
    "number" : "7.4.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "22e1767283e61a198cb4db791ea66e3f11ab9910",
    "build_date" : "2019-09-27T08:36:48.569419Z",
    "build_snapshot" : false,
    "lucene_version" : "8.2.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Kibana 运行在 http://localhost:5601,在浏览器中打开。

注意:如果您的 docker 运行在本地计算机以外的某个服务器上,则将 localhost 替换为该服务器主机