我正在用flume后台处理目录,并将文件上传到hdfs中。这些是txt/csv文件,我希望它们在hdfs中采用这种格式。但是flume正在将它们作为二进制文件加载。。。
这是我的配置:
tier1.sources = source1
tier1.channels = channel1
tier1.sinks = sink1
tier1.sources.source1.type = spooldir
tier1.sources.source1.channels = channel1
tier1.sources.source1.spoolDir = /var/data
tier1.sources.source1.fileHeader = false
tier1.sources.source1.deletePolicy = immediate
tier1.channels.channel1.type = memory
tier1.sinks.sink1.type = hdfs
tier1.sinks.sink1.channel = channel1
tier1.sinks.sink1.hdfs.path = /user/hdfs/%y-%m-%d/
tier1.sinks.sink1.hdfs.writeFormat=Text
tier1.sinks.sink1.hdfs.useLocalTimeStamp = true
tier1.sinks.sink1.hdfs.rollInterval = 30
tier1.channels.channel1.capacity = 100
我应该改变什么使flume将txt文件加载为txt文件?
1条答案
按热度按时间7gs2gvoe1#
这将解决您的问题:
tier1.sinks.sink1.hdfs.filetype=数据流
tier1.sinks.sink1.hdfs.writeformat=文本