Flume spooldir主动source示例

来源:互联网 发布:好牧人12网络牧养中心 编辑:程序博客网 时间:2024/06/05 20:44

vim test02

# example.conf: A single-node Flume configuration# Name the components on this agenta1.sources = r1a1.sinks = k1a1.channels = c1# Describe/configure the sourcea1.sources.r1.type =spooldira1.sources.r1.spoolDir=/opt/flume# Describe the sinka1.sinks.k1.type=hdfsa1.sinks.k1.hdfs.path=hdfs://node1:8020/flume/%Y-%m-%d/%H%Ma1.sinks.k1.hdfs.rollCount=0a1.sinks.k1.hdfs.rollInterval=60a1.sinks.k1.hdfs.rollSize=10240a1.sinks.k1.hdfs.idleTimeout=3a1.sinks.k1.hdfs.fileType=DataStreama1.sinks.k1.hdfs.useLocalTimeStamp=truea1.sinks.k1.hdfs.round=truea1.sinks.k1.hdfs.roundValue=5a1.sinks.k1.hdfs.roundUnit=minute# Use a channel which buffers events in memorya1.channels.c1.type = memorya1.channels.c1.capacity = 1000a1.channels.c1.transactionCapacity = 100# Bind the source and sink to the channela1.sources.r1.channels = c1a1.sinks.k1.channel = c1
8020rpc端口

rollInterval 时间间隔

rollSize 文件大小

rollCount 写的次数,配0则不考虑

三个条件最先满足则关闭流。


mkdir /opt/flume

$ bin/flume-ng agent --conf apache-flume-1.6.0-bin/conf/ --conf-file test02 --name a1 -Dflume.root.logger=INFO,console
在/opt/flume中添加文件即可。