多路复制案例
一个source的数据,同时写入到多个channel中,多个channel中的数据是一样的。 Agent1 -à agent2/agent3 Agent1: Source:netcat Channel:memory 2 Sink:avro 2 Agent2: Agent3: Source:avro Channel:memory Sink:logger Agent之间的通信 avro 利用一个选择器: Selecttor.type 决定多路取数据的规则
Agent1的配置: case_six_agent01.properties
Agent2的配置: case_six_agent02.properties
Agent3的配置: case_six_agent02.properties
上传,发送文件:(也直接发到相应节点上可以)
启动: 先启动agent2 和 agent3: hadoop02: bin/flume-ng agent --conf conf --conf-file /home/hadoop/case_six_agent02.properties --name a1 -Dflume.root.logger=INFO,console hadoop03: bin/flume-ng agent --conf conf --conf-file /home/hadoop/case_six_agent03.properties --name a1 -Dflume.root.logger=INFO,console 再启动agent1: flume-ng agent --conf conf --conf-file /home/hadoop/case_six_agent01.properties --name a1 -Dflume.root.logger=INFO,console 发送消息
|