flume监控日志上传到kafka

本文介绍了如何使用Flume监控日志并将其发送到Kafka。首先,安装了与JDK1.8兼容的Flume 1.8版本。接着,配置了Flume-conf.properties文件,设置source为exec来连接Kafka。在运行过程中遇到了通道满或意外失败的问题,导致源尝试在4000ms后重试,并且读取的事件未提交,需要重置位置。文中还引用了他人遇到的EventDeliveryException问题,详细解析了源码中的readEvent错误。
摘要由CSDN通过智能技术生成

安装

  1. 安装1.8版本对应jdk1.8
  2. 修改后缀是template的文件

连接kafka source为exec

  1. 配置flume-conf.properties

agent.sources = s1
agent.channels = c1
agent.sinks = k1

# For each one of the sources, the type is defined
agent.sources.s1.type = exec
agent.sources.s1.channels = c1
# tail整个文件夹  失败 无法发送至kafka
agent.sources.s1.command = tail -fn 400 /home/joy/test/abc.log

# Each sink's type must be defined
agent.sinks.loggerSink.type = logger

#Specify the channel the sink should use
agent.sinks.loggerSink.channel = c1

# Each channel's type is defined.
agent.channels.c1.type = memory
agent.channels.c1.capacity=10000
agent.channels.c1.transactionCapacity=100

# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值