两层agent连接
avroSource和avroSink实现跃点agent代理:
配置avro_hop.conf
#a1:
a1.sources = r1
a1.sinks = k1
a1.channels = c1
a1.sources.r1.type = netcat
al.sources.r1.bind = localhost
a1.sources.r1.port = 44444
a1.sinks.k1.type = avro
a1.sinks.k1.bind = localhost
a1.sinks.k1.port = 88888
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
#a2:
a2.sources = r2
a2.sinks = k2
a2.channels = c2
a2.sources.r2.type = avro
a2.sources.r2.bind = localhost
a2.sources.r2.port = 88888
a2.sinks.k2.type = logger
a2.channels.c2.type = memory
a2.channels.c2.capacity = 1000
a2.channels.c2.transactionCapacity = 100
a2.sources.r2.channels = c2
a2.sinks.k2.channel = c2
开启a2 agent:
$> bin/flume-ng agent -f conf/avro_hop.conf -n a2 -Dflume.root.logger=INFO,console
验证a2 agent是否开启
$> netstat -anop | grep 88888
开启a1 agent:
$> bin/flume-ng agent -f conf/avro_hop.conf -n a1
验证a1 agent是否开启
$> netstat -anop | grep 44444
a1上输入数据
$> nc localhost 44444
a2 上输出数据
$> .......
参考链接:
flume官方文档