在 CentOS 上卸载 Filebeat,取决于你当初是用 rpm / yum 还是 tar 包 安装的。下面分别说明。
systemctl stop filebeat
systemctl disable filebeat
yum remove filebeat -y
或(老版本 CentOS):
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(自己写的 service):
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
which filebeat
filebeat version
rpm -qa | grep filebeat
如果没有任何输出,说明已卸载完成。
如果你不确定当初是怎么装的,可以告诉我:
rpm -qa | grep filebeat 的结果which filebeat 的路径我可以帮你判断该用哪种方式卸载。