在 CentOS 中卸载 Filebeat,一般取决于你最初是用 RPM 包 还是 二进制/TAR 包 安装的。下面分别说明。
systemctl stop filebeat
systemctl disable filebeat
yum remove filebeat -y
或使用 rpm:
rpm -e filebeat
rm -rf /etc/filebeat
rm -rf /var/lib/filebeat
rm -rf /var/log/filebeat
如果是手动启动的:
ps -ef | grep filebeat
kill -9 <pid>
如果配置了 systemd(非 RPM):
systemctl stop filebeat
systemctl disable filebeat
rm -f /etc/systemd/system/filebeat.service
systemctl daemon-reload
假设安装在 /opt/filebeat:
rm -rf /opt/filebeat
rm -rf /etc/filebeat
rm -rf /var/lib/filebeat
rm -rf /var/log/filebeat
which filebeat
filebeat version
rpm -qa | grep filebeat
若无输出,说明已卸载干净。
如果你不确定是哪种安装方式,可以发我以下命令的输出,我帮你判断:
rpm -qa | grep filebeat
which filebeat
ls -l /etc/filebeat