elasticsearch
请看安装elasticsearch
安装Kibana
下载
wget https://artifacts.elastic.co/downloads/kibana/kibana-6.0.0-linux-x86_64.tar.gz
解压
tar -zxvf kibana-6.0.0-linux-x86_64.tar.gz
修改配置文件vi kibana.yml修改port,host,elasticurl等
#port
server.port: 5601
#host同上面elasticsearch所述,通常配置localhost或者机器ip,这里0.0.0.0图个方便,便于局域网动态ip访问。
server.host: "0.0.0.0"
#这里是部署在一台机器上,直接localhost,否则指定ip即可
elasticsearch.url: "http://localhost:9200"
后台启动
./bin//kibana
成功即可访问
http://x.x.x.x:5601即可
安装logstash
下载
https://artifacts.elastic.co/downloads/logstash/logstash-6.0.0.tar.gz
解压
tar -zxvf logstash-6.0.0.tar.gz
Logstash没有默认的配置文件,需要手动编辑,vi demo-config.conf
input {
beats {
port => 5044
}
}
# The filter part of this file is commented out to indicate that it
# is optional.
filter {
}
output {
elasticsearch {
hosts => "localhost:9200"
manage_template => false
index => "mc_monitor_%{+YYYY.MM.dd}"
}
}
这是最简单的配置示例
input:数据源,这里打开5044端口监听beats的数据,也可以很多其他的配置方式,如redis、kafka等等
filter:配置拦截器清洗、格式化数据,很多配置方式grok、mutate、json、codec等等
output:输出到elasticsearch,配置模板,索引名称等信息
在logstash-6.0.0目录下nohup ./bin/logstash -f demo-config.conf & 后台启动logstash
/logstash-6.0.0/logs目录下有日志logstash-plain.log,这里可以看到收集过滤转发数据时的报错,很重要。后续调试filter的时候有用
FileBeat安装
[root@iz2ze9d7x8qidhuch2m2mjz software]# wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.0.0-linux-x86_64.tar.gz
tar xzvf filebeat-6.0.0-linux-x86_64.tar.gz
mv filebeat-6.0.0-linux-x86_64 filebeat-6.0.0
cd filebeat-6.0.0
修改配置文件vi filebeat.yml,如下:
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
#----------------------------- Logstash output --------------------------------
output.logstash:
hosts: ["127.0.0.1:5044"]
nohup ./filebeat -c filebeat.yml & 后台启动