【Flume】flume的多工技術multiplexing

來源:互聯網
上載者:User

標籤:flume   複用   複製   通道   

多工技術意在可以將一個event根據配置資訊發送特定的channel上。

A source instance can specify multiple channels, but a sink instance can only specify one channel.

Flume supports fanning out the flow from one source to multiple channels. There are two modes of fan out, replicating and multiplexing

flume支援的從source到多個channel有兩種輸出方式:複製 和 複用

1、複製模式下,source收到的event data是輸出到配置的所有channel上

2、複用模式下,source收到的event data是輸出到配置的特定的channel上

首先這種模式的選擇,flume中通過selector選取器來選擇,預設是複製模式

# list the sources, sinks and channels in the agentagent_foo.sources = avro-AppSrv-source1agent_foo.sinks = hdfs-Cluster1-sink1 avro-forward-sink2agent_foo.channels = mem-channel-1 file-channel-2# set channels for sourceagent_foo.sources.avro-AppSrv-source1.channels = mem-channel-1 file-channel-2# set channel for sinksagent_foo.sinks.hdfs-Cluster1-sink1.channel = mem-channel-1agent_foo.sinks.avro-forward-sink2.channel = file-channel-2# channel selector configurationagent_foo.sources.avro-AppSrv-source1.selector.type = multiplexingagent_foo.sources.avro-AppSrv-source1.selector.header = Stateagent_foo.sources.avro-AppSrv-source1.selector.mapping.CA = mem-channel-1agent_foo.sources.avro-AppSrv-source1.selector.mapping.AZ = file-channel-2agent_foo.sources.avro-AppSrv-source1.selector.mapping.NY = mem-channel-1 file-channel-2agent_foo.sources.avro-AppSrv-source1.selector.default = mem-channel-1
想上面這種情況就是一個複用通道的模式,這裡的header是event 資料的header,根據header的值來判斷輸出到哪一個通道上。

當然上面這種情況適用於將資料來源收集代碼耦合在自身應用代碼中的情況,因為解耦後通過其它方式而不涉及代碼來收集資料,你是無法決定這個event的header資料內容的。


複製模式就更簡單了,略!


【Flume】flume的多工技術multiplexing

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.