栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

filebeat:couldn‘t connect to any of the configured Elasticsearch hosts

filebeat:couldn‘t connect to any of the configured Elasticsearch hosts

最近启用filebeat连ES的时候报错:couldn't connect to any of the configured Elasticsearch hosts

提示无法连接,原因有2个:

原因一: ES配置了密码认证,filebeat里面也需要配置对应的将账号密码配置进去;

output.elasticsearch:
  hosts: [""]
  username: "elastic"
  password: ""
setup.kibana:
  host: ""

原因二:从库使用命令行请求ES,发现连接拒绝;

 查看配置发现是ES 默认localhost访问,其他机器要访问需要修改配置

ES elasticsearch.yml 末尾添加配置

network.host: 0.0.0.0

Kibana也需要添加配置

server.host: "0.0.0.0"

重启生效后curl访问测试:

 启动filebeat:

filebeat setup
Overwriting ILM policy is disabled. Set `setup.ilm.overwrite: true` for enabling.

Index setup finished.
Loading dashboards (Kibana must be running and reachable)
Loaded dashboards
Setting up ML using setup --machine-learning is going to be removed in 8.0.0. Please use the ML app instead.
See more: https://www.elastic.co/guide/en/machine-learning/current/index.html
Loaded machine learning job configurations
Loaded Ingest pipelines

ES日志可以看到已经成功加载

[2021-11-17T10:19:27,234][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [xxxxL] adding index lifecycle policy [filebeat]
[2021-11-17T10:19:29,564][INFO ][o.e.c.m.metadataIndexTemplateService] [xxxxL] adding template [filebeat-7.15.1] for index patterns [filebeat-7.15.1-*]
[2021-11-17T10:19:29,934][INFO ][o.e.c.m.metadataCreateIndexService] [xxxxL] [filebeat-7.15.1-2021.11.17-000001] creating index, cause [api], templates [filebeat-7.15.1], shards [1]/[1]
[2021-11-17T10:19:30,206][INFO ][o.e.x.i.IndexLifecycleTransition] [xxxxL] moving index [filebeat-7.15.1-2021.11.17-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [filebeat]
[2021-11-17T10:19:30,366][INFO ][o.e.x.i.IndexLifecycleTransition] [xxxxL] moving index [filebeat-7.15.1-2021.11.17-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] in policy [filebeat]
[2021-11-17T10:19:30,642][INFO ][o.e.x.i.IndexLifecycleTransition] [xxxxL] moving index [filebeat-7.15.1-2021.11.17-000001] from [{"phase":"hot","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] to [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}] in policy [filebeat]

[INFO ][o.e.c.m.metadataIndexTemplateService] [xxxxL] adding template [filebeat-7.15.1] for index patterns [filebeat-7.15.1-*]

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/584679.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号