如何使用IDE在storm生产集群中提交拓扑 [英] How to submit a topology in storm production cluster using IDE

查看:23
本文介绍了如何使用IDE在storm生产集群中提交拓扑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临一个问题 必须使用storm"客户端脚本提交拓扑,以便 StormSubmitter 知道要上传哪个 jar 同时使用 IDE 将拓扑提交到生产集群,而如果我是同样的事情使用 storm jar 命令在命令行中执行,它就像天堂一样运行.我从 githublink 看到了同样的例子.

I am facing an issue Must submit topologies using the 'storm' client script so that StormSubmitter knows which jar to upload while submitting a topology to a production cluster using IDE, while the same thing if i perform in command line using storm jar command, its running like heaven. I have seen examples of the same from githublink.

为了提交拓扑,我使用了这些行

For submitting topology i am using these set of lines

conf.put(Config.NIMBUS_HOST, NIMBUS_NODE);
conf.put(Config.NIMBUS_THRIFT_PORT,6627);
conf.put(Config.STORM_ZOOKEEPER_PORT,2181);
conf.put(Config.STORM_ZOOKEEPER_SERVERS,ZOOKEEPER_ID);
conf.setNumWorkers(20);
conf.setMaxSpoutPending(5000);
StormSubmitter submitter = new StormSubmitter();
submitter.submitTopology("test", conf, builder.createTopology());

请告诉我这是否是正确的运行方法?

Please suggest me if this is the correct approach to run?

推荐答案

很好地找到了解决方案.当我们运行storm jar"时,它会在提交的jar 中触发storm.jar 的属性标志.因此,如果我们想以编程方式提交一个 jar,那么只需以这种方式设置标志

Well found the solution. When we ran "storm jar" it trigger a property flag for storm.jar in the submitted jar. So if we want to programmatically submit a jar then simply set the flag this way

System.setProperty("storm.jar", );

例如:

System.setProperty("storm.jar", "/Users/programming/apache-storm-1.0.1/lib/storm-core-1.0.1.jar");
StormSubmitter.submitTopology("myTopology", config, builder.createTopology());

这篇关于如何使用IDE在storm生产集群中提交拓扑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆