Logstash 输出到 hdfs
由于ES集群价格较为昂贵,相对来讲还是Hadoop平台便宜,耐用。
简介
logstash 可以直接把文件内容写入 hdfs 中, 并支持 hdfs 压缩格式。但是需要安装第三方插件,webhdfs插件,通过hdfs的web接口写入,即 http://namenode00:50070/webhdfs/v1/ 接口。
安装
1 | /usr/local/elk/logstash/bin/logstash-plugin install logstash-output-webhdfs-discontinued |
一般情况下不会出问题,至少我目前没有遇到过。
检查hdfs端口是否可访问
1 | curl hdfs:50070 |
配置output
1 | input{ |
配置好重启即可。
参数说明
上述配置文件中基本为必选项或者为建议参考值。


压缩模式说明

参考链接
https://www.elastic.co/guide/en/logstash/6.4/plugins-outputs-webhdfs.html