简体   繁体   English

如何调试Apache Storm Python

[英]How to Debug Apache Storm Python

I have Apache Storm setup in IntelliJ to run in local mode. 我在IntelliJ中安装了Apache Storm,以在本地模式下运行。 I can run the starter topologies just fine. 我可以很好地运行入门级拓扑。 However, I'd like to know how to debug Python bolts. 但是,我想知道如何调试Python螺栓。 So as a simple example, how would one debug splitsentences.py for the WordCountTopology ? 因此,作为一个简单的示例,如何调试WordCountTopology splitsentences.py

If you have pydev installed (or you don't mind installing it), you can debug remote applications following this instructions . 如果您已安装pydev (或不介意安装它),则可以按照以下说明调试远程应用程序。

pydev is quite ok if you have Java background since it is basically eclipse. 如果您具有Java背景,则pydev很好,因为它基本上是蚀。 Installing it is fairly straightforward following this . 安装是相当简单的跟随

In my machine, the remote debugging works for local processes. 在我的机器中,远程调试适用于本地进程。 I have pydev installed over Eclipse Mars . 我在Eclipse Mars安装了pydev

(I don't think this would be important, but in my case I have two different installations of Eclipse in my machine, one for Java and one for pydev .) (我认为这并不重要,但是就我而言,我在计算机中安装了两种不同的Eclipse安装,一种用于Java,另一种用于pydev 。)

Hope it helps. 希望能帮助到你。

I can only give a "high level" answer: 我只能给出“高级”答案:

Using Storm's multilang feature results in forking off a new process that executes the external code. 使用Storm的多语言功能会导致产生执行外部代码的新流程。 Thus, a new java.lang.UNIXProcess is started that executes the python command as specified in WordCountTopology: 因此,将启动一个新的java.lang.UNIXProcess ,它执行WordCountTopology中指定的python命令:

public SplitSentence() { super("python", "splitsentence.py"); }

You need to do a remote debug session and attach to this process from within Eclipse. 您需要执行一个远程调试会话,并从Eclipse中附加到此过程。 However, as I am not familiar with Python I don't know how to remote debug Python in Eclipse. 但是,由于我不熟悉Python,所以我不知道如何在Eclipse中远程调试Python。

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

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