# 定义agent名称
agent1.sources = source1
agent1.sinks = sink1
agent1.channels = channel1# 配置source1,监控单个文件
agent1.sources.source1.type = spooldir
agent1.sources.source1.spoolDir = /home/lq/datas
agent1.sources.source1.fileHeader = true
agent1.sources.source1.basenameHeader = true
agent1.sources.source1.fileSuffix = .COMPLETED# 配置channel1,使用内存通道
agent1.channels.channel1.type = memory
agent1.channels.channel1.capacity = 1000
agent1.channels.channel1.transactionCapacity = 100# 配置sink1,将数据写入HDFS
agent1.sinks.sink1.type = hdfs
agent1.sinks.sink1.hdfs.path = hdfs://hadoop101:8020/user/flume
agent1.sinks.sink1.hdfs.filePrefix = events-
agent1.sinks.sink1.hdfs.fileSuffix = .log
agent1.sinks.sink1.hdfs.rollInterval = 600
agent1.sinks.sink1.hdfs.rollSize = 0
agent1.sinks.sink1.hdfs.rollCount = 10000
agent1.sinks.sink1.hdfs.fileType = DataStream
agent1.sinks.sink1.hdfs.writeFormat = Text
agent1.sinks.sink1.hdfs.useLocalTimeStamp = true# 配置source1和sink1之间的连接
agent1.sources.source1.channels = channel1
agent1.sinks.sink1.channel = channel1
flume监控单个文件到hdfs
最新推荐文章于 2024-01-09 22:07:52 发布