0

我刚刚开始了解 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 

我认为获取 Elastic Search 连接时出现问题。但我认为弹性搜索实例已经成功启动。当我跑

./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 
4

2 回答 2

4

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

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

elasticsearch.hosts: ["http://192.168.0.101:9200"]
于 2019-09-01T15:06:17.757 回答
0

注意:Elasticsearch 7.4.0、Kibana 7.4.0

状态:工作。

我正在使用 docker-compose.yml 文件在 localhost 上运行 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

弹性搜索在 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 替换为该服务器主机

于 2021-01-28T20:39:00.487 回答