学习进度笔记(二十)

   今天在做实验六的内容:Spark Streaming 编程初级实践。

   

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

# Describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.channels = c1
a1.sources.r1.bind = 0.0.0.0
a1.sources.r1.port = 4141

# Describe the sink
a1.sinks.k1.type = logger

# 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

将helloworld.txt放在flume的主目录路径下。

启动agent

./bin/flume-ng agent agent -c conf -f ./conf/avro.conf -n a1 -Dflume.root.logger=INFO,console
在同目录下新建一个命令终端,使用avro-client发送文件
./bin/flume-ng avro-client -H localhost -p 4141 -F ./helloworld.txt
posted @ 2024-02-17 15:22  早起早起^^  阅读(10)  评论(0)    收藏  举报