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

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

问题描述

使用IDE将拓扑提交到生产集群时,我遇到问题Must submit topologies using the 'storm' client script so that StormSubmitter knows which jar to upload,如果我使用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", <path-to-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天全站免登陆