@hai046
2015-12-18T02:53:09.000000Z
字数 1921
阅读 1121
storm 相关
版本:0.10.0
下载地址:http://storm.apache.org/downloads.html
下载到/opt/storm
master storm 在10.10.5.11
所有的storm配置都一样 在storm/conf 主要配置 storm.yaml 文件
########### These MUST be filled in for a storm configurationstorm.zookeeper.servers:- "zk.d.jiemoapp.com"# - "server2"#nimbus.host: "10.10.5.11"# nimbus.host: "nimbus"#storm.local.dir: "/data/storm/data"# ##### These may optionally be filled in:supervisor.slots.ports:- 6700- 6701- 6702- 6703### List of custom serializations# topology.kryo.register:# - org.mycompany.MyType# - org.mycompany.MyType2: org.mycompany.MyType2Serializer### List of custom kryo decorators# topology.kryo.decorators:# - org.mycompany.MyDecorator### Locations of the drpc serversdrpc.servers:- "10.10.5.11"- "10.10.5.92"
注意:这里的supervisor 是storm 节点
启动:
使用 bin/storm 可以查看具体的命令 主要用到的几个注释如下
[root@fung storm]# bin/stormCommands:activateclasspathdeactivatedev-zookeeperdrpc //开启rpc模式传递数据helpjar //上传topology jar 包killlistlocalconfvaluelogviewermonitornimbus //开启master服务 如果谁是master谁开启rebalanceremoteconfvaluereplshellsupervisor //开启节点服务ui //开启webUI可视化界面upload-credentialsversionHelp:helphelp <command>
我们的测试项目 http://hg.s.diandian.com/jiemo-storm
官方例子在 安装包 example 下
编译注意:
编译jar时候 storm依赖不需要一块打包
<dependency><groupId>org.apache.storm</groupId><artifactId>storm-core</artifactId><version>0.10.0</version><!-- keep storm out of the jar-with-dependencies --><scope>provided</scope></dependency>
但是如果是在ide里面运行远程或者本地模式运行test的时候 需要去掉 provided
测试例子 MatchFriendTopology
官方doc 有点老,里面的LinearDRPCTopologyBuilder等已经 deprecated
可以使用最新使用TridentTopology
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
的
*分布式 RPC(Remote Procedure Call Protocol)远程过程调用协议
使用线性 DRPC 拓扑构造
LinearDRPCTopology