排查CentOS上的Filebeat連接問題可以按照以下步驟進行:
/var/log/filebeat/ 或 /var/log/beats/filebeat/ 目錄下。sudo tail -f /var/log/filebeat/filebeat 查看實時日志。/etc/filebeat/filebeat.yml 或 /etc/beats/filebeat/filebeat.yml)中的設置是正確的。path.logs: 指定要監控的日志文件路徑是否正確。output.logstash 或 output.elasticsearch: 確保輸出插件的配置正確,包括地址、端口和其他相關設置。processors: 如果有自定義的處理器,請確保它們的配置正確。top 或 htop 命令查看系統資源使用情況。sudo ufw allow 5044
ping 命令或 telnet 命令來測試網絡連接。sudo chmod 644 /etc/filebeat/filebeat.yml
sudo systemctl status filebeat
filebeat.service - Filebeat
Loaded: loaded (/usr/lib/systemd/system/filebeat.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2021-06-21 10:00:00 UTC; 1min ago
Main PID: 12345 (filebeat)
CGroup: /system.slice/filebeat.service
└─12345 /usr/bin/filebeat -c /etc/filebeat/filebeat.yml
sudo yum remove --purge filebeat
sudo yum autoremoves
sudo yum clean all
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.14.0-linux-amd64.tar.gz
tar -xzf filebeat-7.14.0-linux-amd64.tar.gz
sudo mv filebeat-7.14.0-linux-amd64 /usr/share/filebeats
sudo ln -s /usr/share/filebeat/bin/filebeat /usr/local/bin/filebeat
sudo systemctl start filebeat
通過以上步驟,您應該能夠在CentOS中成功排查和解決Filebeat的故障。如果問題仍然存在,請提供更多詳細信息,以便進一步幫助你。