在 CentOS 上重启 Filebeat 服务,通常取决于你使用的 系统版本(CentOS 6 还是 7/8) 以及 安装方式(RPM 包 / 二进制)。以下是常见方法:
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
ps -ef | grep filebeat
sudo kill -9 <pid>
sudo /path/to/filebeat -c /path/to/filebeat.yml &
sudo systemctl status filebeat
# 或
tail -f /var/log/filebeat/filebeat
如果你不确定是哪种方式,可以告诉我:
cat /etc/redhat-release)rpm -qa | grep filebeat)我可以帮你精确判断。