简体   繁体   English

Apache Storm拓扑部署

[英]Apache Storm Topology deployment

I am a novice in Apache Storm. 我是Apache Storm的新手。 I have created a storm project in java in intellij and it successfully creates a local cluster and submits the topology to it and runs locally. 我已经在intellij的Java中创建了一个Storm项目,它成功创建了一个本地集群并将拓扑提交给它并在本地运行。 I want to run this storm project on amazon EC2. 我想在Amazon EC2上运行此风暴项目。 I have followed the link https://github.com/nathanmarz/storm-deploy/wiki . 我遵循了链接https://github.com/nathanmarz/storm-deploy/wiki Following the link successfully launched 2 intances of Supervisor, 1 instance of Zookeeper and 1 instance of Nimbus. 通过该链接成功启动了2个Supervisor实例,1个Zookeeper实例和1个Nimbus实例。 Now I want to run my topology on server. 现在,我想在服务器上运行拓扑。 This is my first project in storm so please answer my following question: 这是我的第一个风暴计划,请回答以下问题:

  • Will I have to launch another instance to run storm project? 我是否必须启动另一个实例来运行风暴项目?
  • Do I have to create a jar of the storm java project and scp it to server to run it as they have mentioned in their docs storm jar path/to/allmycode.jar org.me.MyTopology arg1 arg2 arg3 ? 我是否必须按照他们的文档storm jar path/to/allmycode.jar org.me.MyTopology arg1 arg2 arg3 ,创建一个Storm Java项目的jar并将其scp到服务器才能运行它?

Yes, you need to create a jar file that contains your spouts/bolts classes (and an entry point class containing a main method if you want to submit via bin/storm jar command). 是的,您需要创建一个包含spouts / bolts类的jar文件(如果要通过bin/storm jar命令提交,则需要一个包含main方法的入口点类)。

Manually uploading the jar file is not required . 不需要手动上传jar文件。 If you submit from an IDE or via bin/storm jar command, the jar is uploaded automatically. 如果从IDE或通过bin/storm jar命令提交,则jar将自动上传。

To answer your second question. 回答第二个问题。 This is the way that I've solved the problem up to this point. 到目前为止,这是我解决问题的方式。 Manually scp'd the jar to the Amazon instance and uploaded through the command line client. 手动将jar打包到Amazon实例,然后通过命令行客户端上传。

There seems to be an open issue in creating a REST API to upload that way. 创建REST API进行上传似乎存在一个未解决的问题 I don't really the status on that issue though. 不过,我在这个问题上的地位并不高。

Here is another stackoverflow question dealing with remote submission, but I have not tried using this technique. 这是另一个涉及远程提交的stackoverflow问题 ,但是我没有尝试使用这种技术。

first of all you must compile your topology in cluster mode, then deliver it to nimbus(does not matter how, via scp or another one, i have used WinScp), then run it with command bin/storm jar path/to/jar mainClass.java args so, 1) answer to the first question. 首先,您必须在集群模式下编译拓扑,然后将其交付给nimbus(无论如何,通过scp或另一个,我都使用WinScp),然后使用命令bin / storm jar path / to / jar mainClass运行它.java args这样,1)回答第一个问题。 no, you have to run your topology on nimbus, not another machine. 不,您必须在nimbus而不是另一台计算机上运行拓扑。 2) answer to the second one. 2)回答第二个。 yes, you must deliver your jar to nimbus(does not matter how), and run it as written in instruction(documentation) 是的,您必须将jar交付给nimbus(无关紧要),并按照说明(文档)中的说明运行它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM