千家信息网

centos7部署EFK7

发表于:2025-12-01 作者:千家信息网编辑
千家信息网最后更新 2025年12月01日,这篇文章给大家分享的是centos7部署EFK7的详细教程,相信大部分人都还不知道怎么部署,为了让大家学会,故而给大家总结了以下内容。环境:system: CentOS Linux release 7
千家信息网最后更新 2025年12月01日centos7部署EFK7

这篇文章给大家分享的是centos7部署EFK7的详细教程,相信大部分人都还不知道怎么部署,为了让大家学会,故而给大家总结了以下内容。

环境:

system: CentOS Linux release 7.7.1908

elasticsearch: elasticsearch-7.5.1-1.x86_64

kibana: kibana-7.5.1-1.x86_64

filebeat: filebeat-7.5.1-1.x86_64

1. 配置EFK的yum环境

    rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch


创建一个yum源文件

vim efk.repo:

[elasticsearch]name=Elasticsearch repository for 7.x packagesbaseurl=https://artifacts.elastic.co/packages/7.x/yumgpgcheck=1gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearchenabled=0autorefresh=1type=rpm-md[elastic-7.x]name=Elastic repository for 7.x packagesbaseurl=https://artifacts.elastic.co/packages/7.x/yumgpgcheck=1gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearchenabled=1autorefresh=1type=rpm-md[kibana-7.x]name=Kibana repository for 7.x packagesbaseurl=https://artifacts.elastic.co/packages/7.x/yumgpgcheck=1gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearchenabled=1autorefresh=1type=rpm-md

2. 安装EFK

    yum install --enablerepo=elasticsearch elasticsearch    yum install kibana    yum install filebeat

3. 配置EFK

a. 配置elasticsearch

vim /etc/elasticsearch/elasticsearch.yml

    node.name: node-1    cluster.initial_master_nodes: ["node-1"]    http.port: 9200    network.host: 0.0.0.0

b. 配置kibana

vim /etc/kibana/kibana.yml

    server.port: 5601    server.host: "0.0.0.0"    elasticsearch.hosts: [" #ip改成部署了elasticsearch服务的机器ip    kibana.index: ".kibana"

c. 配置filebeat

vim /etc/filebeat/filebeat.yml

    setup.kibana:       host: "  # ip改成部署了kibana服务的机器ip        output.elasticsearch:       hosts: ["localhost:9200"]            # ip改成部署了elasticsearch服务的机器ip, 我这里是一台机器,所以localhost等于11.22        filebeat.inputs:    - type: log       enabled: false       paths:        # 日志收集的路径        - /var/log/*.log

启动EFK服务

systemctl start elasticsearch.service

如果有关elasticsearch的启动问题,点击: https://blog.51cto.com/liuxiaolan/2463905

systemctl start kibana.service

systemctl start filebeat.service

关于centos7部署EFK7就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

0