web-dev-qa-db-ja.com

Filebeatが別のサーバーのlogstashに接続できない

Filebeat(11.11.11.11)は、別のサーバー(22.22.22.22)のlogstash(connection reset by peer)に接続できません。しかし、他のサーバーからのfilebeatサービスはそれを行うことができます。

また、私はcanこのサーバー(11.11.11.11)からtelnetを使用してこのポート(telnet 22.22.22.22 5044)に接続します。

Filebeatログで"failed":34816,"total":34816を確認できます。

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
Dmitry

これについてはわかりませんが、詳細情報を得るためにデバッグを有効にすることができます:

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"]
2
djv