a1.sources = r1
a1.sinks = k1
a1.channels = c1 #使用内置kafka source
a1.sources.r1.type = org.apache.flume.source.kafka.KafkaSource
#kafka连接的zookeeper
a1.sources.r1.zookeeperConnect = localhost:
a1.sources.r1.topic = kkt-test-topic
a1.sources.r1.batchSize =
a1.sources.r1.channels =c1 #这里写到hdfs中
a1.sinks.k1.channel = c1
a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path =hdfs://iz94rak63uyz/user/flume
a1.sinks.k1.hdfs.writeFormat = Text
a1.sinks.k1.hdfs.fileType = DataStream
a1.sinks.k1.hdfs.rollInterval =
a1.sinks.k1.hdfs.rollSize =
a1.sinks.k1.hdfs.rollCount =
a1.sinks.k1.hdfs.batchSize =
a1.sinks.k1.hdfs.txnEventMax =
a1.sinks.k1.hdfs.callTimeout =
a1.sinks.k1.hdfs.appendTimeout = # Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity =
a1.channels.c1.transactionCapacity = # Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
启动flume命令:
flume-ng agent --conf-file flume.conf --name a1 -Dflume.root.logger=INFO,console --conf = conf