Flume中的选择器主要是用于决定source进入哪个channel中,主要有两种选择器:
replicating selector:将event复制到该source对应的所有channel中。
multiplexing selector:指定特定header的值进入某个channel。
如果没有指定选择器,默认使用replcating selector。
案例-replicating selector:
这里配置一个source,两个channel,两个sink。
- 创建自定义conf文件
[root@hadoop01 test_conf]# pwd
/usr/local/wyh/apache-flume-1.8.0-bin/test_conf
[root@hadoop01 test_conf]# cat test-replicating-selector.conf
myagent.sources=mysource1
myagent.channels=mychannel1 mychannel2
myagent.sinks=mysink1 mysink2
myagent.sources.mysource1.type=syslogtcp
myagent.sources.mysource1.host=hadoop01
myagent.sources.mysource1.port=8888
myagent.sources.mysource1.selector.type=repl