[关闭]
@hai046 2015-12-18T02:53:09.000000Z 字数 1921 阅读 1087

storm

storm 相关


安装

版本:0.10.0
下载地址:http://storm.apache.org/downloads.html

下载到/opt/storm
master storm 在10.10.5.11

所有的storm配置都一样 在storm/conf 主要配置 storm.yaml 文件

  1. ########### These MUST be filled in for a storm configuration
  2. storm.zookeeper.servers:
  3. - "zk.d.jiemoapp.com"
  4. # - "server2"
  5. #
  6. nimbus.host: "10.10.5.11"
  7. # nimbus.host: "nimbus"
  8. #
  9. storm.local.dir: "/data/storm/data"
  10. # ##### These may optionally be filled in:
  11. supervisor.slots.ports:
  12. - 6700
  13. - 6701
  14. - 6702
  15. - 6703
  16. #
  17. ## List of custom serializations
  18. # topology.kryo.register:
  19. # - org.mycompany.MyType
  20. # - org.mycompany.MyType2: org.mycompany.MyType2Serializer
  21. #
  22. ## List of custom kryo decorators
  23. # topology.kryo.decorators:
  24. # - org.mycompany.MyDecorator
  25. #
  26. ## Locations of the drpc servers
  27. drpc.servers:
  28. - "10.10.5.11"
  29. - "10.10.5.92"

注意:这里的supervisor 是storm 节点

启动:
使用 bin/storm 可以查看具体的命令 主要用到的几个注释如下

  1. [root@fung storm]# bin/storm
  2. Commands:
  3. activate
  4. classpath
  5. deactivate
  6. dev-zookeeper
  7. drpc //开启rpc模式传递数据
  8. help
  9. jar //上传topology jar 包
  10. kill
  11. list
  12. localconfvalue
  13. logviewer
  14. monitor
  15. nimbus //开启master服务 如果谁是master谁开启
  16. rebalance
  17. remoteconfvalue
  18. repl
  19. shell
  20. supervisor //开启节点服务
  21. ui //开启webUI可视化界面
  22. upload-credentials
  23. version
  24. Help:
  25. help
  26. help <command>

jiemo-storm

我们的测试项目 http://hg.s.diandian.com/jiemo-storm
官方例子在 安装包 example 下

编译注意:
编译jar时候 storm依赖不需要一块打包

  1. <dependency>
  2. <groupId>org.apache.storm</groupId>
  3. <artifactId>storm-core</artifactId>
  4. <version>0.10.0</version>
  5. <!-- keep storm out of the jar-with-dependencies -->
  6. <scope>provided</scope>
  7. </dependency>

但是如果是在ide里面运行远程或者本地模式运行test的时候 需要去掉 provided

测试例子 MatchFriendTopology

官方doc 有点老,里面的LinearDRPCTopologyBuilder等已经 deprecated
可以使用最新使用TridentTopology

上传jar 命令: storm jar target/jiemo-storm-*.jar storm.starter.BasicDRPCTopology storm.starter.BasicDRPCTopology

其他

官方文档:http://storm.apache.org/documentation.html
中文http://qq85609655.iteye.com/blog/2035717

spout是Storm里面一个topology里面的消息生产者

提交topology到远程服务器

DRPC例子讲解 官方原文 http://storm.apache.org/documentation/Distributed-RPC.html 中文详细讲解
http://blog.chinaunix.net/uid-233938-id-3198826.html

Distributed RPC

*分布式 RPC(Remote Procedure Call Protocol)远程过程调用协议

使用线性 DRPC 拓扑构造
LinearDRPCTopology

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注