Flume 聚合

需求:hadoop102 上的 Flume-1 监控文件/opt/module/data/group.log,hadoop103 上的 Flume-2 监控某一个端口的数据流,Flume-1 与 Flume-2 将数据发送给 hadoop104 上的 Flume-3,Flume-3 将最终数据打印到控制台。
配置flume2.conf
################## name ##################
a2.sources = r1
a2.sinks = k1
a2.channels = c1

################## source ##################
a2.sources.r1.type = TAILDIR
a2.sources.r1.filegroups = f1
a2.sources.r1.filegroups.f1 = /opt/module/data/flume.log
a2.sources.r1.positionFile = /opt/module/flume/position/position2.json

################## channel ##################
a2.channels.c1.type = memory
a2.channels.c1.capacity = 1000
a2.channels.c1.transactionCapacity = 100

################## sink ##################
a2.sinks.k1.type = avro
a2.sinks.k1.hostname = hadoop104
a2.sinks.k1.port = 4141

################## bind ##################
a2.sources.r1.channels = c1
a2.sinks.k1.channel = c1

配置flume3.conf

################## name ##################
a3.sources = r1
a3.sinks = k1 
a3.channels = c1

################## source ##################
a3.sources.r1.type = netcat
a3.sources.r1.bind = localhost
a3.sources.r1.port = 44444


################## channel ##################
a3.channels.c1.type = memory
a3.channels.c1.capacity = 1000
a3.channels.c1.transactionCapacity = 100

################## sink ##################
a3.sinks.k1.type = avro
a3.sinks.k1.hostname = hadoop104
a3.sinks.k1.port = 4141

################# bind ##################
a3.sources.r1.channels = c1
a3.sinks.k1.channel = c1

配置flume4.conf

################## name ##################
a4.sources = r1
a4.sinks = k1 
a4.channels = c1

################## source ##################
a4.sources.r1.type = avro
a4.sources.r1.bind = hadoop104
a4.sources.r1.port = 4141


################## channel ##################
a4.channels.c1.type = memory
a4.channels.c1.capacity = 1000
a4.channels.c1.transactionCapacity = 100

################## sink ##################
a4.sinks.k1.type = logger

################## bind ##################
a4.sources.r1.channels = c1
a4.sinks.k1.channel = c1

 

 

 

posted @ 2020-06-09 18:17  地中有山  阅读(225)  评论(0编辑  收藏  举报