flumeの中のhdfs sink roundとroll

1278 ワード

http://blog.csdn.net/kntao/article/details/49278239
http://flume.apache.org/FlumeUserGuide.html#exec-source
デフォルトはSequenceFileですので、hdfs上でコマンドで確認すると文字化けが発生します。この場合はfiletypeとwriteFormatを修正する必要があります。
hdfs.fileType
SequenceFile
File format:currently SequenceFile DataStream or CommpresedStream (1)DataStream will not copress output file and please don’t set codeC(2)Copresed Stream requires set hdfs.co deC available codeC
そのうち、DataStreamはテキストファイルです。
a1.sinks.k1.type = hdfs
a1.sinks.k1.channel = c1
a1.sinks.k1.hdfs.path = /maats/%{APPSTORE}/%Y%m%d/%H
a1.sinks.k1.hdfs.filePrefix = events-
a1.sinks.k1.hdfs.round = true
a1.sinks.k1.hdfs.roundValue = 10
a1.sinks.k1.hdfs.roundUnit = minute
a1.sinks.k1.hdfs.useLocalTimeStamp = true
a1.sinks.k1.hdfs.fileType=DataStream
a1.sinks.k1.hdfs.writeFormat=Text