共计 1506 个字符,预计需要花费 4 分钟才能阅读完成。
storm 集群部署和我的项目部署
wget http://mirror.bit.edu.cn/apache/storm/apache-storm-1.2.2/apache-storm-1.2.2.tar.gz
tar -zxvf apache-storm-1.2.2.tar.gz
cd apache-storm-1.2.2
vim conf/storm.yaml 配置
storm.local.dir: "/data/liang/datas/storm"
storm.zookeeper.servers:
- "10.2.45.3"
- "10.2.45.4"
- "10.2.45.5"
storm.zookeeper.port: 2181
nimbus.seeds: ["10.2.45.5"]
ui.port: 8081
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
storm 我的项目部署
应用 maven 命令把依赖的 jar 打到 target/dependency 目录下
clean dependency:copy-dependencies
而后把 storm-core-1.2.1.jar 包去掉, 复制到 apache-storm-1.2.2/extlib 目录下
mkdir app
应用 maven 命令 clean install 打的包 sjz-rta-app-1.0-SNAPSHOT.jar
把 rta.yaml 配置文件 sjz-rta-app-1.0-SNAPSHOT.jar 放在 app 目录
../bin/storm jar sjz-rta-app-1.0-SNAPSHOT.jar com.liang.ecpm.rta.AppRTA 运行
应用插件 maven-assembly-plugin 参看 gj-bus-server 或 xinyun 的实时计费我的项目
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>1.2.1</version>
<scope>provided</scope> 打包时这里须要这个配置 (本地运行不必)
</dependency>
应用 maven 命令 clean install 打的包 sjz-rta-app-1.0-SNAPSHOT-jar-with-dependencies.jar 会把所有依赖的 jar 包都打在一起
间接能够运行
../bin/storm jar sjz-rta-app-1.0-SNAPSHOT-jar-with-dependencies.jar com.liang.ecpm.rta.AppRTA
../bin/storm kill rta-sjz-v1-daili-fei -w 3
../bin/storm kill saveDbStormStart -w 3
../bin/storm kill RealPassengerServer -w 3
../bin/storm kill ScheduleRealServer -w 3
../bin/storm jar sjz-rta-app-1.0-SNAPSHOT.jar com.liang.ecpm.rta.AppRTA -nimbus carlan152 -port 6627
../bin/storm jar sjz-rta-app.jar com.liang.ecpm.rta.AppRTA -nimbus carlan152 -port 6627
../bin/storm jar sjz-rta-app-passenger-schedule.jar com.liang.ecpm.rta.AppRTA cluster
正文完