1、nc输入源、memory作管道、logger作sink
- 配置flume-conf.properties
### demo 1
# a1 source
a1.sources = r1
a1.channels = c1
a1.sinks = k1
# a1
a1.sources.r1.type = netcat
a1.sources.r1.channels = c1
a1.sources.r1.bind = 0.0.0.0
a1.sources.r1.port = 4141
# a1 sink
a1.sinks.k1.type = logger
# a1 channel
a1.channels.c1.type = memory
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
-
启动脚本
./flume-ng agent -c ../conf -f ../conf/flume-conf.properties -n a1 -Dflume.root.logger=INFO,console
-
测试
image.png
新建1个窗口,nc localhost 4141
然后输入内容,在flume启动的那个窗口就会看到日志输出
网友评论