Storm基礎(chǔ)(三)配置

原文鏈接:http://storm.apache.org/releases/1.0.2/Configuration.html

本人原創(chuàng)翻譯,轉(zhuǎn)載請注明出處

Storm有多種配置選項來調(diào)整nimbus, supervisors, 和運行中topologies的行為。有的配置是系統(tǒng)配置,不能在topology層面修改。在Storm代碼庫的defaults.yaml中,每個配置都有一個默認值。你可以定義storm.yaml來覆蓋默認配置,這個文件要放到Nimbus和Supervisors的classpath下。最后,你可以在用StormSubmitter提交topology的時候定義topology級別的配置。但是,topology級別的配置只能覆蓋"TOPOLOGY"前綴的配置。

Storm 0.7.0及之前的版本允許你覆蓋bolt或spout級別的配置,只有以下幾種配置可以這樣做:
1."topology.debug"
2."topology.max.spout.pending"
3."topology.max.task.parallelism"
4."topology.kryo.register": This works a little bit differently than the other ones, since the serializations will be available to all components in the topology. More details on Serialization.

Java API支持兩種方式來配置組件:
1.內(nèi)部:在任何spout或bolt中重寫getComponentConfiguration,返回組件級別配置的map。
2.外部:在TopologyBuilder的setSpout和setBolt中返回一個包含addConfiguration、addConfigurations方法的對象,可以用來覆蓋組件的配置。

配置的優(yōu)先順序是:defaults.yaml < storm.yaml < topology specific configuration < internal component specific configuration < external component specific configuration.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容