nginx-hdfs.conf

a1.sources = r1
a1.sinks = k1
a1.channels = c1

a1.sources.r1.type = TAILDIR
a1.sources.r1.positionFile = /root/flume/taildir_position.json
a1.sources.r1.filegroups = f1
a1.sources.r1.filegroups.f1 = /root/flume/logs/.*log

#指定内存channels
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

a1.sinks.k1.type = hdfs
#按日期生成目录,必须添加header
a1.sinks.k1.hdfs.useLocalTimeStamp=true
a1.sinks.k1.hdfs.path = hdfs://hadoop3801:9000/flume/access-logs/%y-%m-%d
a1.sinks.k1.hdfs.filePrefix = events-
#生成文件的时间
a1.sinks.k1.hdfs.rollInterval=30
#不按条数生成文件
a1.sinks.k1.hdfs.rollCount=0
#生成文件的大小
a1.sinks.k1.hdfs.rollSize=104857600
#文件写入到HDFS中的存储格式
a1.sinks.k1.hdfs.fileType=DataStream

Bind the sink to the channel

a1.sources.r1.channels=c1
a1.sinks.k1.channel = c1

猜你喜欢

转载自blog.csdn.net/qq_43020785/article/details/85837734