在 CentOS 上重启 Filebeat,通常取决于你是用 systemd 还是 ** SysV init** 方式安装的。现在大多数 CentOS 7/8 都是 systemd。
sudo systemctl restart filebeat
sudo systemctl status filebeat
sudo systemctl stop filebeat
sudo systemctl start filebeat
sudo systemctl enable filebeat
sudo service filebeat restart
或
sudo /etc/init.d/filebeat restart
修改了 filebeat.yml 后,建议先测试配置:
sudo filebeat test config
如启用了输出(如 Elasticsearch / Logstash),也可测试:
sudo filebeat test output
sudo journalctl -u filebeat -f
或
tail -f /var/log/filebeat/filebeat
如果你是在 容器 / Kubernetes / 源码运行 的 Filebeat,重启方式会不同,可以告诉我你的部署方式。