1、Load Balancing Sink Processorshell
===> agent_2
apache
source ==> agent_1 ===> agent_3 ==> Sinkspa
===> agent_4
code
agent_2,agent_3,agent_4 分擔agent_1的數據壓力ip
[root@hftest0001 conf]# pwd /opt/apache-flume-1.6.0-bin/conf [root@hftest0001 conf]# vi s-exec_c-m_s-avro_sp-lb.conf agent.sinkgrous.lb-1.sinks = 155-avroSink 154-avroSink agent.sinkgrous.lb-1.processor.type = load_balance #agent.sinkgrous.lb-1.processor.backoff = true agent.sinkgrous.lb-1.processor.selector = round_robin #agent.sinkgrous.lb-1.processor.selector.maxTimeOut = 3000 agent.sinks.155-avroSink.type = avro agent.sinks.155-avroSink.hostname = ${ip-155} agent.sinks.155-avroSink.port = 55555 agent.sinks.155-avroSink.channel = memoryChannel agent.sinks.154-avroSink.type = avro agent.sinks.154-avroSink.hostname = ${ip-154} agent.sinks.154-avroSink.port = 55555 agent.sinks.154-avroSink.channel = memoryChannel agent.channels.memoryChannel.type = memory agent.channels.memoryChannel.capacity = 100
2、Failover Sink Processor
ci
[root@hftest0001 conf]# vi s-exec_c-m_s-avro_sp-fo.conf agent.sinkgrous.lb-1.sinks = 155-avroSink 154-avroSink agent.sinkgrous.lb-1.processor.type = failover agent.sinkgrous.lb-1.processor.priority.155-avroSink = 5 agent.sinkgrous.lb-1.processor.priority.154-avroSink = 10 => 設置權重 agent.sinkgrous.lb-1.processor.maxpenalty = 10000 agent.sinks.155-avroSink.type = avro agent.sinks.155-avroSink.hostname = ${ip-155} agent.sinks.155-avroSink.port = 55555 agent.sinks.155-avroSink.channel = memoryChannel agent.sinks.154-avroSink.type = avro agent.sinks.154-avroSink.hostname = ${ip-154} agent.sinks.154-avroSink.port = 55555 agent.sinks.154-avroSink.channel = memoryChannel agent.channels.memoryChannel.type = memory agent.channels.memoryChannel.capacity = 100