Filebeat 无法连接到另一台服务器上的 logstash

Filebeat 无法连接到另一台服务器上的 logstash

Filebeat ( 11.11.11.11) 无法连接到22.22.22.22另一台服务器 ( ) 上的 logstash ( ) connection reset by peer。但其他服务器上的 filebeat 服务可以做到这一点。

我也从此服务器连接(11.11.11.11)使用远程登录至此端口(telnet 22.22.22.22 5044)。

我可以"failed":34816,"total":34816在 filebeat 日志中看到:

root@stage /var/log/filebeat # tail filebeat
2018-05-09T08:30:48.298Z    INFO    [monitoring]    log/log.go:124  Non-zero metrics in the last 30s    {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":2390,"time":2392},"total":{"ticks":539690,"time":539696,"value":539690},"user":{"ticks":537300,"time":537304}},"info":{"ephemeral_id":"e0b9a5bb-4446-4ee1-a6f4-e2b0ccfb1677","uptime":{"ms":2340029}},"memstats":{"gc_next":205064832,"memory_alloc":146205312,"memory_total":29895393656}},"filebeat":{"harvester":{"open_files":39,"running":48}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"batches":17,"failed":34816,"total":34816},"write":{"bytes":17029928,"errors":17}},"pipeline":{"clients":3,"events":{"active":4119,"retry":69632}}},"registrar":{"states":{"current":139}},"system":{"load":{"1":0.24,"15":0.43,"5":0.31,"norm":{"1":0.03,"15":0.0538,"5":0.0388}}}}}}
2018-05-09T08:30:48.391Z    ERROR   pipeline/output.go:92   Failed to publish events: write tcp 11.11.11.11:34626->22.22.22.22:5044: write: connection reset by peer
2018-05-09T08:30:49.943Z    ERROR   logstash/async.go:235   Failed to publish events caused by: write tcp 11.11.11.11:34632->22.22.22.22:5044: write: connection reset by peer
2018-05-09T08:30:50.943Z    ERROR   pipeline/output.go:92   Failed to publish events: write tcp 11.11.11.11:34632->22.22.22.22:5044: write: connection reset by peer
2018-05-09T08:30:51.383Z    ERROR   logstash/async.go:235   Failed to publish events caused by: write tcp 11.11.11.11:34634->22.22.22.22:5044: write: connection reset by peer
2018-05-09T08:30:52.383Z    ERROR   pipeline/output.go:92   Failed to publish events: write tcp 11.11.11.11:34634->22.22.22.22:5044: write: connection reset by peer
2018-05-09T08:30:53.942Z    ERROR   logstash/async.go:235   Failed to publish events caused by: write tcp 11.11.11.11:34636->22.22.22.22:5044: write: connection reset by peer
2018-05-09T08:30:54.942Z    ERROR   pipeline/output.go:92   Failed to publish events: write tcp 11.11.11.11:34636->22.22.22.22:5044: write: connection reset by peer
2018-05-09T08:30:55.407Z    ERROR   logstash/async.go:235   Failed to publish events caused by: write tcp 11.11.11.11:34654->22.22.22.22:5044: write: connection reset by peer
2018-05-09T08:30:56.407Z    ERROR   pipeline/output.go:92   Failed to publish events: write tcp 11.11.11.11:34654->22.22.22.22:5044: write: connection reset by peer

filebeat 已经是最新版本 (6.2.4)。logstash
已经是最新版本 (1:6.2.4-1)。

如何解决或调查?

更新
如果我关闭 logstash,错误会改变:

ERROR   pipeline/output.go:74   Failed to connect:
dial tcp 22.22.22.22:5044: getsockopt: connection refused

答案1

我不确定这一点,但你肯定可以启用调试来获取更多信息:

https://www.elastic.co/guide/en/beats/filebeat/current/enable-filebeat-debugging.html

我还会检查 logstash 和 filebeat 配置:

Logstash:

在这种情况下,正在接收,并且应该具有如下所示的输入配置

input {
  beats {
    port => "5044"
    ssl  => false
  }
}

确保 logstash 服务有权在机器上打开监听套接字。使用

netstat -l

Filebeat:

检查 filebeat 是否指向正确的 logstash 端口

 output:
  logstash:
    hosts: ["22.22.22.22:5044"]

相关内容