温馨提示×

centos如何重启filebeat

小樊
50
2026-09-18 02:43:17
栏目: 智能运维

在 CentOS 上重启 Filebeat,通常取决于你是用 systemd 还是 ** SysV init** 方式安装的。现在大多数 CentOS 7/8 都是 systemd。


一、使用 systemd(推荐,CentOS 7/8/Stream)

重启 Filebeat

sudo systemctl restart filebeat

查看状态

sudo systemctl status filebeat

停止 / 启动

sudo systemctl stop filebeat
sudo systemctl start filebeat

开机自启(如未开启)

sudo systemctl enable filebeat

二、使用 service 命令(兼容旧版本)

sudo service filebeat restart

或

sudo /etc/init.d/filebeat restart

三、确认配置无误后再重启(很重要)

修改了 filebeat.yml 后,建议先测试配置:

sudo filebeat test config

如启用了输出(如 Elasticsearch / Logstash),也可测试:

sudo filebeat test output

四、查看 Filebeat 日志

sudo journalctl -u filebeat -f

或

tail -f /var/log/filebeat/filebeat

如果你是在 容器 / Kubernetes / 源码运行 的 Filebeat,重启方式会不同,可以告诉我你的部署方式。

0 踩