1:选择版本
1.9.0版本
2:下载
官网进行下载
3:解压
4:配置环境变量
export FLUME_HOME=/opt/apache-flume-1.9.0-bin
export PATH=${PATH}:${FLUME_HOME}/bin
6:测试
./flume-ng version
7:收集日志文件信息
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# Describe/configure the source
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /opt/tmp/data.log
a1.sources.r1.shell = /bin/sh -c
# 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
# 指定source的channel 一个source可以绑定多个channel
# 指定sink的channel 一个sink只能绑定一个chanel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
8:编写启动脚本
flume-ng agent \
--name a1 \
--conf $FLUME_HOME/conf \
--conf-file /opt/apache-flume-1.9.0-bin/conf/project_conf/a2.conf \
-Dflume.root.logger=INFO,console
9:如果需要不同类型的source | sink 可以去官网进行阅读文档