温馨提示×

CentOS与Filebeat集成步骤是什么

小樊
48
2025-08-06 12:50:22
栏目: 智能运维

CentOS与Filebeat集成步骤如下:

  1. 安装Filebeat:可通过EPEL仓库安装,命令为sudo yum install epel-release,然后sudo yum install filebeat;也可手动下载RPM包安装,如wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.x.x-linux-x86_64.rpm,再执行sudo rpm -ivh filebeat-7.x.x-linux-x86_64.rpm
  2. 配置Filebeat:编辑/etc/filebeat/filebeat.yml文件,设置要监控的日志路径filebeat.inputs和Elasticsearch的输出地址output.elasticsearch等参数,如filebeat.inputs: - type: log enabled: true paths: - /var/log/*.logoutput.elasticsearch: hosts: ["localhost:9200"]
  3. 启动Filebeat:运行sudo systemctl start filebeat,并设置为开机自启动sudo systemctl enable filebeat
  4. 验证集成:通过查看Filebeat日志sudo tail -f /var/log/filebeat/filebeat.log,或检查Elasticsearch集群状态curl -X GET "localhost:9200/_cluster/health?pretty"来验证是否集成成功。

0