【发布时间】:2015-08-13 10:36:55
【问题描述】:
我已经与 Storm 合作了一段时间,但想开始开发。正如建议的那样,我使用的是 IntelliJ(到目前为止,我使用的是 Eclipse,并且只针对 Java API 编写拓扑)。
我也在看 https://github.com/apache/storm/tree/master/examples/storm-starter#intellij-idea
此文档不完整。我无法首先在 Intellij 中运行任何东西。我可以弄清楚,我需要删除storm-core依赖的范围(在storm-starter pom.xml中)。 (在这里找到:storm-starter with intellij idea,maven project could not find class)
之后我就可以构建项目了。我也可以在 IntelliJ 中毫无问题地运行 ExclamationTopology。但是,WordCountTopology 失败。
首先我收到以下错误:
java.lang.RuntimeException: backtype.storm.multilang.NoOutputException: 到子进程的管道似乎坏了!没有输出读取。 序列化程序异常: 回溯(最近一次通话最后): 文件“splitsentence.py”,第 16 行,在 进口风暴 ImportError: 没有名为storm的模块
更新:无需安装python-storm 即可使其工作
我能够通过以下方式解决它:apt-get install python-storm(来自 StackOverflow)
但是,我不会说 Python,我想知道问题出在哪里以及为什么我可以这样解决它。只是想更深入地了解它。也许有人可以解释一下。
不幸的是,我现在遇到了另一个错误:
java.lang.RuntimeException: backtype.storm.multilang.NoOutputException: 到子进程的管道似乎坏了!没有输出读取。 序列化程序异常: 回溯(最近一次通话最后): 文件“splitsentence.py”,第 18 行,在 类SplitSentenceBolt(storm.BasicBolt): AttributeError: 'module' 对象没有属性 'BasicBolt'
我在 Internet 上没有找到任何解决方案。在dev@storm.apache.org 询问也无济于事。我提出以下建议:
我认为总是假设拓扑总是会通过storm-命令行调用。因此工作目录将是 ${STORM-INSTALLATION}/bin/storm 由于storm.py 在这个目录中,splitSentence.py 将能够找到storm 模块。您可以将工作目录设置为storm.py所在的路径,然后尝试。如果可行,我们可以稍后将其添加到文档中
但是,改变工作目录并没有解决问题。
由于我不熟悉 Python,而且我是 IntelliJ 的新手,所以我现在被困住了。因为ExclamationTopology 运行,我猜我的基本设置是正确的。
我做错了什么?完全可以在 IntelliJ 中运行 WordcountTopology in LocalCluster 吗?
【问题讨论】:
标签: python intellij-idea apache-storm