flume 安装与配置:
下载flume,然后解压:
tar xvf apache-flume-1.5.2-bin.tar.gz -C ./
配置flume,在conf/flume-conf.properties下(没有则创建,反正有template):
# example.conf: A single-node Flume configuration
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# Describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44446
# Describe the sink
a1.sinks.k1.type = logger
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
启动flume:

本文介绍了如何使用Flume进行日志接收,包括Flume的安装配置,以及在Java项目中结合Log4j进行日志记录的实例。通过配置log4j.properties,并在Maven工程中指定flume-ng-log4jappender依赖,将日志发送到Flume,最终查看Flume的日志文件,确认日志已成功收集。
最低0.47元/天 解锁文章
6539

被折叠的 条评论
为什么被折叠?



