原文鏈接: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.