一 配置文件r_avro.conf
a1.sources = r1
a1.sinks = k1
a1.channels = c1
a1.sources.r1.type = avro
a1.sources.r1.bind =0.0.0.0
a1.sources.r1.port= 4141
a1.sinks.k1.type = logger
a1.channels.c1.type = memory
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
二 启动flume
flume-ng agent --conf-file /opt/apache-flume-1.7.0-bin/conf/r_avro.conf --name a1 -Dflume.root.logger=INFO,console
三 准备test.txt文件
[root@master data]# cat test.txt
very good
good morning
go to school
四 启动avro-client发送数据
flume-ng avro-client -F /opt/apache-flume-1.7.0-bin/data/test.txt -H localhost -p 4141
五 观察结果