当我把一个文件放到本地目录( vagrant/flume/test.csv
),在hdfsFlume中( /user/inputs/test.csv.1591560702234
),我想知道为什么hdfs 1591560702234
以及如何移除它!
这是我的flume.conf文件
# Flume agent config
a1.sources = r1
a1.sinks = k2
a1.channels = c1
a1.channels.c1.type = file
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.sources.r1.channels = c1
a1.sources.r1.type = spooldir
a1.sources.r1.basenameHeader = true
a1.sources.r1.spoolDir = /vagrant/flume
a1.sinks.k2.type = hdfs
a1.sinks.k2.channel = c1
a1.sinks.k2.hdfs.filePrefix = %{basename}
a1.sinks.k2.hdfs.writeFormat = Text
# a1.sinks.k2.hdfs.fileSuffix =
a1.sinks.k2.hdfs.fileType = DataStream
a1.sinks.k2.hdfs.path = /user/inputs/
a1.sinks.k2.rollInterval = 0
a1.sinks.k2.rollSize = 0
a1.sinks.k2.rollCount = 0
a1.sinks.k2.idleTimeout = 0
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k2.channel = c1
1条答案
按热度按时间wlp8pajw1#
flume以毫秒为单位添加时间。从你的例子来看:
我认为用flume配置删除时间戳是不可能的。
但是你可以加一个后缀
hdfs.fileSuffix
. 根据文件:您还可以在一个文件中放置更多具有某些flume属性的事件
请检查
批量大小
卷大小
滚动时间
滚动计数
您还可以使用hdfs命令合并目录。
将源目录和目标文件作为输入,并将src中的文件连接到目标本地文件中。也可以将-nl设置为允许在每个文件的末尾添加换行符(lf)-跳过空文件可以用来避免在空文件的情况下不需要的换行符。
示例: