Flume configuration to upload files with same name

左心房为你撑大大i 提交于 2019-12-06 10:06:18

ok, you need a few more props fro hdfs sink:

a1.sinks.k2.hdfs.filePrefix = [your prefix]
a1.sinks.k2.hdfs.fileSuffix = .[your suffix]

suffix would be .tsv or .csv for instance, while prefix can be anything - you can also use variables for date and time - this requires that you use the timestamp interceptor. You can also create your own interceptor and generate your own variables into your file name. If you omit this, flume will add its own sequence between prefix and suffix.

As an addition to our previous comments, the props to disable rollovers are the following:

a1.sinks.k2.rollInterval = 0
a1.sinks.k2.rollSize = 0
a1.sinks.k2.rollCount = 0
a1.sinks.k2.idleTimeout = 0

to access the file name of the original file from your source, append the following in your hdfs sink config:

a1.sinks.k2.hdfs.filePrefix = %{file}

to simplify your channel config, do the following:

a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000

Thanks much for your help Erik it helped to go close to the problem i found that flume was creating a file in the data source directory .flumespool which i had to delete along with /mnt/flume/* and also rename the data file to the same name as it was if it was changed to .COMPLETED

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!