温馨提示×

centos怎么查看filebeat状态

小樊
45
2026-09-24 05:22:11
栏目: 智能运维

在 CentOS 上查看 Filebeat 状态,常用以下几种方式,取决于它是怎么安装的(systemd / 二进制直接运行)。


一、使用 systemd(最常见,yum/rpm 安装)

1. 查看 Filebeat 运行状态

systemctl status filebeat

常见状态说明:

  • active (running):正在运行
  • inactive (dead):未运行
  • failed:启动失败

2. 启动 / 停止 / 重启

systemctl start filebeat
systemctl stop filebeat
systemctl restart filebeat

3. 设置开机自启

systemctl enable filebeat

二、查看 Filebeat 进程

ps -ef | grep filebeat

或

pgrep -a filebeat

如果有输出,说明进程在运行。


三、查看 Filebeat 端口(如果启用)

Filebeat 一般 不监听端口,但如果配置了 http.enabled: true:

ss -lntp | grep filebeat

四、查看日志(排查问题非常重要)

systemd 日志

journalctl -u filebeat -f

Filebeat 自身日志(默认路径)

tail -f /var/log/filebeat/filebeat

五、使用 Filebeat 命令查看状态(推荐)

查看 Filebeat 是否正常工作

filebeat test config

✅ 输出 Config OK 表示配置没问题

测试输出(如 Elasticsearch / Logstash)

filebeat test output

六、如果是二进制直接运行(非 systemd)

ps -ef | grep filebeat

或进入安装目录:

./filebeat status

快速排查清单 ✅

  • [ ] systemctl status filebeat
  • [ ] journalctl -u filebeat
  • [ ] filebeat test config
  • [ ] filebeat test output

如果你愿意,可以贴一下:

  • CentOS 版本
  • Filebeat 安装方式(rpm / 二进制)
  • systemctl status filebeat 的输出

我可以帮你具体看是什么问题。

0 踩