首页 新闻 会员 周边

filebeat无法连接 拒绝连接

0
悬赏园豆:10 [已解决问题] 解决于 2024-01-12 15:43

具体错误

ERROR [publisher_pipeline_output] pipeline/output.go:154 Failed to connect to backoff(elasticsearch(http://localhost:9200)): Get "http://localhost:9200": dial tcp [::1]:9200: connectex: No connection could be made because the target machine actively refused it.

文件配置


问题描述

只配置了这两个地方, 但是运行的时候怎么也运行不起来, 一直说是拒绝访问
看着日志文件好像也都读取到了

求各位大神这是为啥呢

问题补充:

图片好像没传上来
配置文件修改的地方1
ilebeat.inputs:

Each - is an input. Most options can be set at the input level, so

you can use different inputs for various configurations.

Below are the input specific configurations.

  • type: log

    Change to true to enable this input configuration.

    enabled: true

    Paths that should be crawled and fetched. Glob based paths.

    paths:

    • C:\Log\TraceabilityWebLog**.log

    - c:\programdata\elasticsearch\logs*

配置文件修改的地方 2
output.elasticsearch:

Array of hosts to connect to.

hosts: ["localhost:9200"]

Protocol - either http (default) or https.

protocol: "https"

Authentication credentials - either API key or username/password.

api_key: "id:api_key"

username: "elastic"

password: "changeme"

临冰听雪丶的主页 临冰听雪丶 | 初学一级 | 园豆:191
提问于:2024-01-11 17:57
< >
分享
最佳答案
0

1、查看防火墙

2、localhost改成真实ip,而不是localhost和127.0.0.1

收获园豆:5
Biuget-Golang | 小虾三级 |园豆:784 | 2024-01-12 10:08



加了的呀

临冰听雪丶 | 园豆:191 (初学一级) | 2024-01-12 10:10

换了也不得行

临冰听雪丶 | 园豆:191 (初学一级) | 2024-01-12 10:22

@临冰听雪丶: 看最新的提示,可解决

Biuget-Golang | 园豆:784 (小虾三级) | 2024-01-12 11:48

@Biuget-Golang: 什么意思呢 是我版本的问题吗

临冰听雪丶 | 园豆:191 (初学一级) | 2024-01-12 11:57
其他回答(1)
0

1.能读到日志,只能说明filebeat订阅日志文件成功了,只是Sink到ES的时候出错了。
2.可以看到写到ES的时候报错,看报错是连接不通。
3.先在filebeat这台机器,测试访问es的端口 看通不通。(一般情况:ES未正确启动、端口被占、防火墙、ES 配置问题: 检查es 配置,确保它允许远程连接,并且网络绑定正确。)

收获园豆:5
Beyond-bit | 园豆:2885 (老鸟四级) | 2024-01-12 02:24

没问题呀

我改成了 127.0.0.1:9200

也不得行

支持(0) 反对(0) 临冰听雪丶 | 园豆:191 (初学一级) | 2024-01-12 09:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册