首页 > 解决方案 > 设置filebeat并使其连接到弹性搜索时出错

问题描述

我提取了 filbeat 和弹性搜索的 docker 图像。我运行容器。我在运行命令中设置了弹性搜索“discovery.type=single-node”的环境变量。我配置了filebeat.yml apache.yml elastisearch.yml。但我收到以下错误:

退出:无法连接到任何已配置的 Elasticsearch 主机。错误:[与 Elasticsearch http://elasticsearch:9200的连接错误:获取http://elasticsearch:9200:在 192.168.65.1:53 上查找 elasticsearch:没有这样的主机]

我的文件beat.yml:

 filebeat.config:
  modules:
    path: ${path.config}/modules.d/apache.yml
    reload.enabled: true

    setup.dashboards.enabled: true
    setup.kibana.host: "http://kibana:5601"

    #processors:
    #- add_cloud_metadata: 

    output.elasticsearch:
      hosts: [ "http://elasticsearch:9200" ]
      #username: '${ELASTICSEARCH_USERNAME:}'
      #password: '${ELASTICSEARCH_PASSWORD:}'

我的 apache.yml:

- module: apache
  # Access logs
  access:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    var.paths: C:\Users\saivishal.vangala\Desktop\filbeatdemo

  # Error logs
  error:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:

我的弹性搜索.yml:

cluster.name: "docker-cluster"
network.host: 0.0.0.0

当我尝试重新启动 filebeat 的容器时,它没有启动。我认为它已损坏。

标签: elasticsearchfilebeat

解决方案


推荐阅读