flume接收netcat程序发送来的数据

你要安装好flume
进入conf目录下

flume接收netcat程序发送来的数据_第1张图片

vi 或者 vim 			vi flume-poll.conf  修改配置文件
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1


# Describe/configure the source
# 修改这里,type是你连接的类型,port是你连接的端口,可以改,但是nc端口时要一样
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 8080


# Describe the sink
a1.sinks.k1.type = logger
# 连接idea,如果接收netcat传来的数据就把以下三行注释
a1.sinks.k1.type = org.apache.spark.streaming.flume.sink.SparkSink
a1.sinks.k1.hostname=node01
a1.sinks.k1.port = 8888


# 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
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

你可能感兴趣的:(Flume)