在 CentOS 上重启 Filebeat,取决于你是通过 systemd 还是 直接运行二进制 安装的。下面是最常见的几种方式。
如果你是通过 RPM 包 安装的 Filebeat(官方推荐方式),使用 systemctl 管理。
sudo systemctl restart filebeat
sudo systemctl status filebeat
sudo systemctl enable filebeat
sudo systemctl stop filebeat
sudo systemctl start filebeat
ps -ef | grep filebeat
kill -9 <PID>
cd /path/to/filebeat
./filebeat -e -c filebeat.yml
⚠️ 这种方式不会自动重启,生产环境不推荐。
journalctl -u filebeat -f
或查看 Filebeat 自身日志(如果配置了):
tail -f /var/log/filebeat/filebeat
systemctl restart filebeat 没反应?检查是否真的由 systemd 管理:
systemctl list-unit-files | grep filebeat
✅ 需要
sudo systemctl restart filebeat
# 重启 Filebeat(推荐)
sudo systemctl restart filebeat
# 查看状态
sudo systemctl status filebeat
如果你愿意,可以告诉我:
我可以给你更精确的操作建议。