继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

flume配置多源sink

三国纷争
关注TA
已关注
手记 288
粉丝 50
获赞 175

一、配置示意图:

webp

二、Flume参数配置说明:

webp

三、问题记录:

滚动生成新文件说明
1.minBlockReplicas=1  该值设为1
参考:flume中sink到hdfs,文件系统频繁产生文件,文件滚动配置不起作用?
http://blog.csdn.net/simonchi/article/details/43231891
2.rollCount/rollSize/rollInterval最好简单配置,(只设置一个,多个不知道能不能成功,其他设为0)

四、配置列表:

a1.sources = r1
a1.sinks = k1 k2
a1.channels = c1 c2
a1.sources.r1.selector.type = replicating# Describe/configure the sourcea1.sources.r1.type = http
a1.sources.r1.port = 5140
a1.sources.r1.handler = org.apache.flume.source.http.JSONHandler

a1.sources.r1.channels = c1 c2# Use a channel which buffers events in memorya1.sinks.k1.channel = c1
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

a1.sinks.k2.channel = c2
a1.channels.c2.type = memory
a1.channels.c2.capacity = 1000
a1.channels.c2.transactionCapacity = 100######to kafka# Describe the sink k1a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.topic = testa1.sinks.k1.brokerList = 192.168.206.10:9092
a1.sinks.k1.requiredAcks = 1
a1.sinks.k1.batchSize = 20#####a1 to hdfs###### Describe the sinka1.sinks.k2.type = hdfs
a1.sinks.k2.hdfs.path = hdfs://master:9000/flume/%Y%m%d
a1.sinks.k2.hdfs.filePrefix = log_%H_%M
a1.sinks.k2.hdfs.fileSuffix = .loga1.sinks.k2.hdfs.useLocalTimeStamp = truea1.sinks.k2.hdfs.writeFormat = Text
a1.sinks.k2.hdfs.fileType = DataStream####one hour savea1.sinks.k2.hdfs.round = truea1.sinks.k2.hdfs.roundValue = 1
a1.sinks.k2.hdfs.roundUnit = hour#### write new file file 1Ma1.sinks.k2.hdfs.rollInterval = 0
a1.sinks.k2.hdfs.rollSize=1048576
a1.sinks.k2.hdfs.rollCount=0

a1.sinks.k2.hdfs.batchSize = 100
a1.sinks.k2.hdfs.threadsPoolSize = 10
a1.sinks.k2.hdfs.idleTimeout = 0
a1.sinks.k2.hdfs.minBlockReplicas = 1



作者:玄月府的小妖在debug
链接:https://www.jianshu.com/p/7a73a887e2f3


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP