ELK+Filebeat 部署实验

Filebeat是轻量级的开源日志文件数据搜集器。通常在需要采集数据的客户端安装 Filebeat,并指定目录与日志格式,Filebeat 就能快速收集数据,并发送给 logstash 进行解析,或是直接发给 Elasticsearch 存储,性能上相比运行于 JVM 上的 logstash 优势明显,是对它的替代。常应用于 EFLK 架构当中。

一、部署filebeat

1、关闭防火墙和安全机制

systemctl disable --now firewalld

setenforce 0

hostnamectl set-hostname filebeat

2、安装nginx服务

yum -y install epel-release.noarch

yum -y install nginx

systemctl enable --now nginx

需要给nginx日志可读权限

3、安装 Filebeat

上传软件包 filebeat-6.7.2-linux-x86_64.tar.gz 到/opt目录

tar xf filebeat-6.7.2-linux-x86_64.tar.gz

mv /opt/filebeat-6.7.2-linux-x86_64 /usr/local/filebeat

4、设置 filebeat 的主配置文件

vim /usr/local/filebeat/filebeat.yml

5、在 Logstash 组件所在节点上新建一个 Logstash 配置文件

vim filebeat.conf

bash 复制代码
input {
    beats { port => "5044" }
}

#filter {}

output {
    elasticsearch {
        hosts => ["192.168.130.10:9200","192.168.130.20:9200","192.168.130.30:9200"]
        index => "%{[fields][server_name]}-%{[fields][log_type]}-%{[fields][from]}-%{+YYYY.MM.dd}"
    }
    stdout {
        codec => rubydebug
    }
}
6、启动 logstash和filebeat

logstash -f filebeat.conf #启动logstash

在/usr/local/filebeat目录中使用./filebeat -e -c filebeat.yml #启动filebeat

7、浏览器访问kibana

http://192.168.130.30:5601

相关推荐
Donk_6712 小时前
ELK+Redis架构搭建
redis·elk·架构
Plastic garden19 小时前
ELK(1)
elk
heimeiyingwang4 天前
【架构实战】日志体系ELK:集中化日志管理实践
elk·架构·wpf
米高梅狮子4 天前
01.ELK企业日志分析系统
运维·服务器·网络·数据库·elk·oracle
叶~小兮6 天前
ELK技术栈全套学习笔记(Elasticsearch+Logstash+Filebeat)
笔记·学习·elk
Cat_Rocky6 天前
k8s-elk日志分析组件学习
学习·elk
RemainderTime7 天前
(十二)Spring Cloud Alibaba 2023.x:基于 Filebeat 构建轻量级 ELK日志追踪体系
分布式·elk·elasticsearch·微服务·架构·logback
明明跟你说过9 天前
Kafka 与 Elasticsearch 的集成应用案例深度解析
大数据·elk·elasticsearch·kafka·big data·bigdata
浓黑的daidai10 天前
day-02
linux·运维·elk
shizhan_cloud12 天前
企业级 ELK 日志分析系统
elk