storm伪集群搭建
准备:
- python 安装 官网https://www.python.org/downloads/windows/
- zookeeper 安装 https://zookeeper.apache.org/ 单机伪集群搭建可以参考网上资料
- storm release版本下载 http://storm.apache.org/downloads.html 下载1.2.1
- jdk 1.7+安装
配置信息
参考4解压release安装包 配置conf/storm.yaml
- zk集群地址
storm.zookeeper.servers:
- "127.0.0.1"
- Nimbus and Supervisor需要的本地状态等信息存储的目录 、每个目录都不同
storm.local.dir: "E:\\storm-local\\data3"
- Nimbus master机器地址,用于toplogy jars和配置信息的分发
nimbus.seeds: ["127.0.0.1"]
- 每个机器节点工作的woker的端口,每个supervisor或nimbus可以区分开,配置不同worker的端口
supervisor.slots.ports:
- 8700
- 8701
- 8702
- 8703
启动
参考4
启动master上的nimbus
bin\storm.py nimbus
启动各个supervisor
bin\storm.py supervisor
启动UI监控
bin\storm.py ui
遇到的问题
cmd bin\storm nimbus 启动失败、建议用Powershell storm.ps1 script替代启动
bin\storm supervisor
This script is deprecated. Please use the Powershell storm.ps1 script instead
错误: 找不到或无法加载主类 Files\Java\jdk1.8.0_121\bin;C:\Program
powershell -file bin\storm.ps1 nimbus 启动报错没有权限被系统禁止,如果修改权限较麻烦 我选择放弃
无法加载文件 E:\storm-cluster\apache-storm-1\bin\storm.ps1,因为在此系统中禁止
执行脚本。有关详细信息,请参阅 "get-help about_signing"。
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordE
xception
+ FullyQualifiedErrorId : RuntimeException
选用python脚本启动
bin\storm.py nimbus
执行任务
上传自己的允许的storm jar到master上,在UI中查看监控执行情况
bin\storm jar allmycode.jar org.me.MyTopology arg1 arg2 arg3