Filebeat 在 CentOS 上“断连”通常指 和 Elasticsearch / Logstash 的连接中断,或 Filebeat 进程异常退出 / 采集停止。下面按常见原因分类说明,并给出排查方法。
排查
telnet es_host 9200
ping es_host
journalctl -u filebeat -f
解决
output.logstash 时确认 hosts 正确output.elasticsearch:
hosts: ["http://es:9200"]
backoff.init: 1s
backoff.max: 60s
现象
connection reset by peer
EOF
i/o timeout
解决
output.logstash:
hosts: ["ls1:5044", "ls2:5044"]
loadbalance: true
CentOS 上常见:
排查
date
openssl s_client -connect es:9200
解决
ssl.certificate_authorities: ["/etc/filebeat/ca.crt"]
systemctl status filebeat
journalctl -u filebeat --since "1 hour ago"
常见原因:
filebeat test config
filebeat test output
logrotate 切割>> 覆盖写解决
close_inactive: 5m
clean_inactive: 72h
ignore_older: 24h
ulimit -n
解决
/etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
/var/lib/filebeat/var/logdf -h
systemctl status filebeatjournalctl -u filebeat -ffilebeat test configfilebeat test outputtelnet es_host 9200如果你能贴出:
我可以直接帮你定位是哪一类断连。