2017-06-07 75 views
0

嗨我試圖從本地文件系統通過flume加載到HDFS文件系統的csv文件。我只有一個文件解析。文件大小小於5MB,但它分裂成在水槽上解析它時有很多部分。這是我的水槽。文件分裂成許多部分在水槽

FileAgent.sources = tail 
FileAgent.channels = Channel-2 
FileAgent.sinks = HDFS 
FileAgent.sources.tail.type = exec 
FileAgent.sources.tail.command = cat /tmp/flumeSpool/2.csv 
FileAgent.sources.tail.channels = Channel-2 

FileAgent.sinks.HDFS.type = hdfs 
FileAgent.sinks.HDFS.hdfs.path = hdfs://127.0.0.1:54310/ 
FileAgent.sinks.HDFS.hdfs.fileType = DataStream 
FileAgent.sinks.HDFS.channel = Channel-2 
FileAgent.channels.Channel-2.type = file 

FileAgent.channels.Channel-2.capacity = 100000 
FileAgent.channels.Channel-2.transactionCapacity = 80000 
FileAgent.sinks.HDFS.hdfs.writeFormat = Text 
FileAgent.sinks.k1.hdfs.rollSize = 10485760 
FileAgent.sinks.k1.hdfs.rollCount = 0 
FileAgent.sinks.k1.hdfs.rollInterval = 300 

任何幫助將不勝感激。

回答

0

您在flume conf文件本身中犯了錯誤。

FileAgent.sinks.HDFS.hdfs.writeFormat = Text 
FileAgent.sinks.k1.hdfs.rollSize = 10485760 
FileAgent.sinks.k1.hdfs.rollCount = 0 
FileAgent.sinks.k1.hdfs.rollInterval = 300 

您已將sink名稱設置爲k1,而您在開始時將其定義爲HDFS。如下 可以重寫成:

FileAgent.sinks.HDFS.hdfs.writeFormat = Text 
FileAgent.sinks.HDFS.hdfs.rollSize = 10485760 
FileAgent.sinks.HDFS.hdfs.rollCount = 0 
FileAgent.sinks.HDFS.hdfs.rollInterval = 300 

由於wrongname的水槽正在默認值以下配置它們是: 輥施膠= 1024(字節) 輥計數= 10(事件) 因此,許多文件。 (如果k1是同一個conf文件中的一些其他接收器,那麼也提及HDFS接收器的所有這些參數)