Flume NG中的Netcat Source

  NetCat是一个非常简单的Unix工具,可以读、写TCP或UDP网络连接(network connection)中数据

  在Flume中的netcat支持Flume与NetCat整合,flume可以使用netcat读取网络中的数据,其主要配置项如下

a1.sources = r1
a1.sinks = k1
a1.channels = c1

# source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444  # 监听44444端口

#  sink
a1.sinks.k1.type = logger

#  memory
......

#  channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

  启动flume(./flume-ng agent –n a1 –f ../conf/example.properties -Dflume.root.logger=INFO,console)后,可以通过(telnet localhost 44444)发送数据,在flume的启动界面就会输出接收到的数据

原文地址:https://www.cnblogs.com/codeOfLife/p/5676278.html