本篇内容主要讲解“EFK的搭建方法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“EFK的搭建方法”吧!
Centos7.0
jdk1.8
elasticsearch-6.3.2 下载地址
filebeat-6.3.2 下载地址
kibana-6.3.2 下载地址
PS:EFK版本请保持一致。
下载FileBeat
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.3.2-linux-x86_64.tar.gz |
解压
tar -zxvf filebeat-6.2.4-linux-x86_64.tar.gz |
进入主目录,修改filebeat.yml
filebeat.prospectors:
- type: log
enabled: true
paths:
# 日志采集目录
- /var/xxx/*.log
multiline.pattern: ^\[
multiline.negate: true
multiline.match: after
setup.kibana:
host: "192.168.1.1:5601"
output.elasticsearch:
hosts: ["192.168.1.1:9200"] |
启动filebeat
./filebeat -e -c filebeat.yml -d "publish" |
后台启动
nohup ./filebeat -e -c filebeat.yml > filebeat.log 2>&1 & |
3、kibana 安装
下载Kibana
wget https://artifacts.elastic.co/downloads/kibana/kibana-6.3.2-linux-x86_64.tar.gz |
解压
tar -zxvf kibana-6.3.2-linux-x86_64.tar.gz |
进入主目录,修改配置
vi config/kibana.yml |
添加以下配置或者取消注释并修改
server.port: 5601
server.host: "0.0.0.0"
server.name: "kibana"
elasticsearch.url: "http://192.168.18.187:9400"
kibana.index: ".kibana"
xpack.security.enabled: false
#随便输入32位数字
xpack.reporting.encryptionKey: "122333444455555666666777777788888888" |
其中elasticsearch.url为Elasticsearch的地址,server.host默认是localhost,如果只是本地访问可以默认localhost,如果需要外网访问,可以设置为0.0.0.0
启动Kibana
./bin/kibana &
关闭
ps -ef|grep node
kill -9 port
到此,相信大家对“EFK的搭建方法”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
原文链接:https://my.oschina.net/u/4102642/blog/3115746