温馨提示×

centosfilebeat如何卸载

小樊
37
2026-10-14 17:47:17
栏目: 智能运维

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


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

1. 停止 Filebeat 服务

systemctl stop filebeat
systemctl disable filebeat

2. 卸载 Filebeat

yum remove filebeat -y

或使用 rpm:

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 管理的:

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 踩