Storm学习第四天

来源:互联网 发布:淘宝ifashion怎么入驻 编辑:程序博客网 时间:2024/06/01 07:28
配置:
     为了调整nimbus,supervisor和运行的topologies的表现,Storm有很多的配置项,一些配置项是系统配置,不能为每一个topology
单独配置,但是有些配置可以以topology为单位进行配置。
     每一个配置的默认值都被定义在https://github.com/apache/storm/blob/v1.0.0/conf/defaults.yaml中,可以通过在storm.yaml中
定义这些配置项来覆盖默认的配置,最终,你能够使用http://storm.apache.org/releases/1.0.0/javadocs/org/apache/storm/StormSubmitter.html
来单独配置每一个topology并且提交这个topology。然而,以topology为单位配置的配置项只能以TOPOLOGY来开头
"topology.debug"
"topology.max.spout.pending"
"topology.max.task.parallelism"
"topology.kryo.register": 这个和其他的配置项工作原理不同,因为序列化在topology的所有组件中都是可行的 
http://storm.apache.org/releases/1.0.0/Serialization.html
java API让你用二种方式配置组件:
1.内部方式:通过在spout和bolt中重写getComponentConfiguration中返回配置map
2.外部方式:调用TopologyBuilder中的setSpout和setBolt方法会返回一个有addConfiguration方法和addConfigurations方法的对象,调用这二个方法就可以配置


配置值的优先级是defaults.yaml<storm.yaml<topology specific configuration<internal component specific configuration<external component specific


资源:
     Config(http://storm.apache.org/releases/1.0.0/Configuration.html): 所有配置的列表和一个创建以topology为单位配置的帮助类
     defaults.yaml(http://github.com/apache/storm/blob/v1.0.0/conf/defaults.yaml): 所有配置的默认值
     Setting up a Storm cluster(http://storm.apache.org/releases/1.0.0/Setting-up-a-Storm-cluster.html): 如何创建和配置Storm集群
     Running topologies on a production cluster(http://storm.apache.org/releases/1.0.0/Running-topologies-on-a-production-cluster.html): 列出在集群中运行topology的配置
     Local mode(http://storm.apache.org/releases/1.0.0/Local-mode.html): 在本地模式运行的有用配置
0 0
原创粉丝点击