storm集群部署和项目部署

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

猜你喜欢

转载自blog.csdn.net/yinjl123456/article/details/125012303