Here simply put a configuration bar, there are questions welcome message discussion
Configuration of the sink
############################# #define [sink] begin############################## #define the sink k1a1.sinks.k1.type= hdfsa1.sinks.k1.channel=c1a1.sinks.k1.hdfs.uselocaltimestamp=truea1.sinks.k1.hdfs.path=hdfs:// 192.168.11.177:9000/flume/events/%y/%m/%da1.sinks.k1.hdfs.fileprefix=cmcc-%ha1.sinks.k1.hdfs.filetype= Datastreama1.sinks.k1.hdfs.minblockreplicas=1a1.sinks.k1.hdfs.rollinterval=3600a1.sinks.k1.hdfs.rollsize= 0a1.sinks.k1.hdfs.rollcount=0a1.sinks.k1.hdfs.idletimeout=0#define the sink k2a1.sinks.k2.channel= c2a1.sinks.k2.type=com.cmcc.chiwei.kafka.cmcckafkasinka1.sinks.k2.metadata.broker.list= 192.168.11.174:9092,192.168.11.175:9092,192.168.11.196:9092a1.sinks.k2.partition.key= 0a1.sinks.k2.partitioner.class=com.cmcc.chiwei.kafka.cmccpartitiona1.sinks.k2.serializer.class= kafka.serializer.stringencodera1.sinks.k2.request.required.acks=0a1.sinks.k2.cmcc.encoding= utf-8a1.sinks.k2.cmcc.topic.name=cmcca1.sinks.k2.producer.type=asynca1.sinks.k2.batchsize=100################# ############ #define [sink] end##############################
Here is the same data no difference sink to multiple outputs, so the channel is the replication mode
A1.sources.r1.selector.type=replicating
One is Kafka, in order to improve performance, with memory channels, one to HDFs, offline analysis, with file channels
############################# #define [Channel] begin############################## #define the channel c1a1.channels.c1.type=filea1.channels.c1.checkpointdir=/home/flume/flumecheckpointa1.channels.c1.datadirs=/ Home/flume/flumedata,/home/flume/flumedataexta1.channels.c1.capacity=2000000a1.channels.c1.transactioncapacity =100#define the channel c2a1.channels.c2.type=memorya1.channels.c2.capacity= 2000000a1.channels.c2.transactioncapacity=100############################# #define [Channel] end################# #############
The above is the non-differential data output multiple sink configuration, if you want to different data to different sink, need to use the Channel multiplexing mode, please refer to "Channel multiplexing"
"Flume" Flume multiple output branches configuration, multi-sink, multi-channel