首页 > Web开发 > 详细

Flume 聚合

时间:2020-06-09 19:29:24      阅读:37      评论:0      收藏:0      [点我收藏+]
需求: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

 

 

 

Flume 聚合

原文:https://www.cnblogs.com/noyouth/p/13079559.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!