Kibana + Elasticsearch + Logstash + Filebeat
2017年12月28日 00:19:25 阅读数:612 标签: elasticsearch 更多
个人分类: elasticsearch
版权声明:欢迎访问个人博客网站 www.dubby.cn,和个人微信公众号ITBusTech https://blog.csdn.net/u011499747/article/details/78917724
原文链接:http://www.dubby.cn/detail.html?id=9080
环境
Ubuntu两台,一台用来安装Elasticserach和Logstash,一台用来安装Filebeat收集本机的日志文件,在本机上安装Kinaba:
IP | 安装 |
---|---|
127.0.0.1(这个不重要) | Kibana |
192.168.126.128 | Elasticsearch + Logstash |
192.168.126.129 | Filebeat + jar(这个jar专门来生成log文件) |
软件版本:
- elasticsearch-6.1.1.tar.gz
- logstash-6.1.1.tar.gz
- filebeat-6.1.1-linux-x86_64.tar.gz
- kibana-6.1.1-windows-x86_64.zip(本地是windows)
配置&启动
Elasticsearch
这个没啥配置的,直接启动:
./elasticsearch/bin/elasticsearch -d
- 1
Logstash
在Logstash目录下创建first-pipeline.conf
:
input {
beats {
port => "5044"
}
}
output {
elasticsearch {
hosts => [ "localhost:9200" ]
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
测试:
./bin/logstash -f first-pipeline.conf --config.test_and_exit
- 1
如果成功执行这个启动:
./bin/logstash -f first-pipeline.conf --config.reload.automatic
- 1
Filebeat
修改filebeat.yml
:
扫描二维码关注公众号,回复:
3271505 查看本文章
filebeat.prospectors:
- type: log
enabled: true
paths:
- /path/*.log
output.logstash:
hosts: ["192.168.126.128:5044"]
- 1
- 2
- 3
- 4
- 5
- 6
- 7
执行命令启动:
./filebeat -e -c filebeat.yml -d "publish"
- 1
Kibana
在本地,修改kibana.yml
:
elasticsearch.url: "http://192.168.126.128:9200"
- 1
启动kibana。