基本操作:

  

编写配置文件:

# 指定Agent的组件名称
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# 指定Flume source(要监听的路径)
#a1.sources.r1.type = spooldir
#a1.sources.r1.spoolDir = /root/path

a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444 


# 指定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

 

命令启动: 启动名字为a1的agent。

bin/flume-ng agent --conf conf --conf-file study/netcat.conf --name a1 -Dflume.root.logger=INFO,console

 

 

测试是否能够接听到

nc localhost 444444

 

 

 

 

 

 

 

 

 

 

官网:  http://www.apache.org/dyn/closer.lua/flume/1.7.0/apache-flume-1.7.0-bin.tar.gz

posted on 2017-08-25 16:21  doscho  阅读(146)  评论(0编辑  收藏  举报