下载flume官网下载
http://flume.apache.org/download.html
上传到虚拟机指定目录,解压t
tar -xzf apache-flume-1.7.0-bin.tar.gz
进入flume下的conf文件下复制flume-conf.properties修改名称为example.conf(名字可以随便改在启动命令是注意名称就行)
修改example.conf文件
# 指定Agent的组件名称
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# 指定Flume source(要监听的路径)
a1.sources.r1.type = spooldir
a1.sources.r1.spoolDir = /home/hadoop/log
# 指定Flume sink
a1.sinks.k1.type = logger
# 指定Flume channel
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# 绑定source和sink到channel上
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
保存退出
启动在flume目录下,这里都是bin、conf等文件夹
bin/flume-ng agent --conf conf --conf-file conf/example.conf --name a1 -Dflume.root.logger=INFO,console
//这里的example.conf是你的配置文件