当前位置 : 主页 > 网络编程 > 其它编程 >

storm2.2.1java+idea实现基本demojar包提交执行

来源:互联网 收集:自由互联 发布时间:2023-07-02
在storm2.2.1javaidea实现基本demo的基础上本地开发环境执行成功后需要提交到storm的测试或生产环境此时需要将项 在storm 2.2.1 java idea实现基本demo的基础上本地开发环境执行成功后需要提交到
在storm2.2.1javaidea实现基本demo的基础上本地开发环境执行成功后需要提交到storm的测试或生产环境此时需要将项

在storm 2.2.1 java idea实现基本demo的基础上本地开发环境执行成功后需要提交到storm的测试或生产环境此时需要将项目打包成jar然后再进行提交。

1. 配置pom.xml文件打包成jar

打包需要指定打包类型和名称。

jarstorm-helloworld

由于运行环境已经有依赖包了所以不需要storm-core所以需要修改scope。

org.apache.stormstorm-core2.2.1provided

添加打包组件

maven-assembly-pluginjar-with-dependenciescom.demo.storm.ExclamationTopology

 执行打包命令

mvn assembly:assembly

在target找到storm-helloworld-1.0-SNAPSHOT-jar-with-dependencies.jar这就是可以提交到storm环境进行执行的jar包。 

2. 执行jar包提交

D:\sdks\apache-storm-2.2.1\bin>storm.py jar storm-helloworld-1.0-SNAPSHOT-jar-with-dependencies.jar com.demo.storm.ExclamationTopology ExclamationTestRunning: D:\sdks\jdk1.8.0_191\bin\java.exe -client -Ddaemon.name -Dstorm.options -Dstorm.homeD:\sdks\apache-storm-2.2.1 -Dstorm.log.dirD:\sdks\apache-storm-2.2.1\logs -Djava.library.path/usr/local/lib:/opt/local/lib:/usr/lib:/usr/lib64 -Dstorm.conf.file -cp D:\sdks\apache-storm-2.2.1\*;D:\sdks\apache-storm-2.2.1\lib-worker\*;D:\sdks\apache-storm-2.2.1\extlib\*;storm-helloworld-1.0-SNAPSHOT-jar-with-dependencies.jar;D:\sdks\apache-storm-2.2.1\conf;D:\sdks\apache-storm-2.2.1\bin; -Dstorm.jarstorm-helloworld-1.0-SNAPSHOT-jar-with-dependencies.jar -Dstorm.dependency.jars -Dstorm.dependency.artifacts{} com.demo.storm.ExclamationTopology ExclamationTest13:23:00.263 [main] INFO o.a.s.StormSubmitter - Generated ZooKeeper secret payload for MD5-digest: -8787587062738558446:-808387676353632202913:23:00.314 [main] WARN o.a.s.v.ConfigValidation - task.heartbeat.frequency.secs is a deprecated config please see class org.apache.storm.Config.TASK_HEARTBEAT_FREQUENCY_SECS for more information.13:23:00.392 [main] INFO o.a.s.u.NimbusClient - Found leader nimbus : DESKTOP-O93E7VQ:662713:23:00.393 [main] INFO o.a.s.s.a.ClientAuthUtils - Got AutoCreds []13:23:00.422 [main] INFO o.a.s.StormSubmitter - Uploading dependencies - jars...13:23:00.423 [main] INFO o.a.s.StormSubmitter - Uploading dependencies - artifacts...13:23:00.423 [main] INFO o.a.s.StormSubmitter - Dependency Blob keys - jars : [] / artifacts : []13:23:00.437 [main] INFO o.a.s.StormSubmitter - Uploading topology jar storm-helloworld-1.0-SNAPSHOT-jar-with-dependencies.jar to assigned location: D:\sdks\apache-storm-2.2.1\storm-local\nimbus\inbox/stormjar-4c0ffedd-8447-4d5f-89a1-1632e5a9f88c.jarStart uploading file storm-helloworld-1.0-SNAPSHOT-jar-with-dependencies.jar to D:\sdks\apache-storm-2.2.1\storm-local\nimbus\inbox/stormjar-4c0ffedd-8447-4d5f-89a1-1632e5a9f88c.jar (4890 bytes)[] 4890 / 4890File storm-helloworld-1.0-SNAPSHOT-jar-with-dependencies.jar uploaded to D:\sdks\apache-storm-2.2.1\storm-local\nimbus\inbox/stormjar-4c0ffedd-8447-4d5f-89a1-1632e5a9f88c.jar (4890 bytes)13:23:00.465 [main] INFO o.a.s.StormSubmitter - Successfully uploaded topology jar to assigned location: D:\sdks\apache-storm-2.2.1\storm-local\nimbus\inbox/stormjar-4c0ffedd-8447-4d5f-89a1-1632e5a9f88c.jar13:23:00.465 [main] INFO o.a.s.StormSubmitter - Submitting topology ExclamationTest in distributed mode with conf {"storm.zookeeper.topology.auth.scheme":"digest","storm.zookeeper.topology.auth.payload":"-8787587062738558446:-8083876763536322029","topology.workers":3,"topology.debug":false}13:23:00.655 [main] INFO o.a.s.StormSubmitter - Finished submitting topology: ExclamationTest

3. 查看运行状态信息

http://localhost:8080/topology.html?idExclamationTest-1-1643347380

3.1 topology状态信息

3.2 输入和执行信息

3.3 worker信息

3.4 可视化

【转自:响水网站制作公司 http://www.1234xp.com/xiangshui.html 复制请保留原URL】
上一篇:JAVA仿微信发红包
下一篇:没有了
网友评论