flume对接kafka时延迟和高吞吐量以及flume筛选日志

18 篇文章 0 订阅


 以下是我的flume配置文件,实现了低延迟,筛选功能

# 命名
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# sources配置
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /root/flume.log
a1.sources.r1.batchSize=1
#a1.sources.r1.type= spooldir
#a1.sources.r1.spoolDir= /opt/flume

# sinks配置
#a1.sinks.k1.type = avro
#a1.sinks.k1.hostname = 172.21.16.46
#a1.sinks.k1.port =44445

a1.sinks.k1.type= org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.brokerList=172.21.16.26:9092
a1.sinks.k1.topic=test22

#一次处理的数据条数 bathsize越高,处理的数据越多,延迟越高
#a1.sinks.k1.serializer.class=kafka.serializer.StringEncoder
a1.sinks.k1.requiredAcks = 1
a1.sinks.k1.batchSize = 1

#filter可以进行筛选日志
#a1.sources.r1.interceptors=i1
#a1.sources.r1.interceptors.i1.type=regex_filter
#a1.sources.r1.interceptors.i1.regex=(helloword)(.*)


# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000000
a1.channels.c1.transactionCapacity = 1000000

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

 

 

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值