温馨提示×

centos filebeat如何卸载

小樊
38
2026-09-02 21:38:15
栏目: 智能运维

在 CentOS 上卸载 Filebeat,取决于你当初是用 rpm / yum 还是 tar 包 安装的。下面分别说明。


一、如果是通过 yum / rpm 安装的(最常见)

1. 停止 Filebeat 服务

systemctl stop filebeat
systemctl disable filebeat

2. 卸载软件包

yum remove filebeat -y

或(老版本 CentOS):

rpm -e filebeat

3. 删除残留文件(可选但推荐)

rm -rf /etc/filebeat
rm -rf /var/lib/filebeat
rm -rf /var/log/filebeat

二、如果是通过 tar 包安装的

1. 停止 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

2. 删除安装目录

假设安装在 /opt/filebeat

rm -rf /opt/filebeat

3. 删除配置和数据

rm -rf /etc/filebeat
rm -rf /var/lib/filebeat

三、验证是否卸载干净

which filebeat
filebeat version
rpm -qa | grep filebeat

如果没有任何输出,说明已卸载完成。


如果你不确定当初是怎么装的,可以告诉我:

  • rpm -qa | grep filebeat 的结果
  • which filebeat 的路径

我可以帮你判断该用哪种方式卸载。

0