风暴启动示例拓扑崩溃

时间:2014-10-26 00:53:24

标签: apache-storm distributed-computing

我刚开始使用OS X 10.9.5上的Twitter Storm框架。但是,我遇到了在storm-starter中运行示例拓扑的问题:https://github.com/apache/storm/tree/master/examples/storm-starter

在自述文件之后,我尝试通过调用

在本地部署拓扑
sudo mvn exec:java -Dstorm.topology=storm.starter.WordCountTopology

拓扑运行不到一分钟,然后以错误终止:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project storm-starter: An exception occured while executing the Java class. java.lang.InterruptedException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project storm-starter: An exception occured while executing the Java class. java.lang.InterruptedException
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. java.lang.InterruptedException
    at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:352)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.RuntimeException: java.lang.InterruptedException
    at backtype.storm.util$wrap_in_runtime.invoke(util.clj:44)
    at backtype.storm.zookeeper$exists_node_QMARK_$fn__907.invoke(zookeeper.clj:102)
    at backtype.storm.zookeeper$exists_node_QMARK_.invoke(zookeep`enter code here`er.clj:98)
    at backtype.storm.zookeeper$mkdirs.invoke(zookeeper.clj:114)
    at backtype.storm.cluster$mk_distributed_cluster_state$reify__1757.mkdirs(cluster.clj:119)
    at backtype.storm.cluster$mk_storm_cluster_state$reify__2214.report_error(cluster.clj:397)
    at backtype.storm.daemon.executor$throttled_report_error_fn$fn__3547.invoke(executor.clj:179)
    at backtype.storm.daemon.executor$fn__3767$fn$reify__3812.reportError(executor.clj:737)
    at backtype.storm.task.OutputCollector.reportError(OutputCollector.java:223)
    at backtype.storm.task.ShellBolt.die(ShellBolt.java:303)
    at backtype.storm.task.ShellBolt.access$800(ShellBolt.java:68)
    at backtype.storm.task.ShellBolt$1.run(ShellBolt.java:137)
    at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.storm.zookeeper.ClientCnxn.submitRequest(ClientCnxn.java:1342)
    at org.apache.storm.zookeeper.ZooKeeper.exists(ZooKeeper.java:1040)
    at org.apache.storm.curator.framework.imps.ExistsBuilderImpl$2.call(ExistsBuilderImpl.java:172)
    at org.apache.storm.curator.framework.imps.ExistsBuilderImpl$2.call(ExistsBuilderImpl.java:161)
    at org.apache.storm.curator.RetryLoop.callWithRetry(RetryLoop.java:107)
    at org.apache.storm.curator.framework.imps.ExistsBuilderImpl.pathInForeground(ExistsBuilderImpl.java:157)
    at org.apache.storm.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:148)
    at org.apache.storm.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:36)
    at backtype.storm.zookeeper$exists_node_QMARK_$fn__907.invoke(zookeeper.clj:101)
    ... 11 more

非常感谢任何帮助。

5 个答案:

答案 0 :(得分:4)

我相信您看到的问题是群集关闭的结果:

参见[./src/jvm/storm/starter/WordCountTopology.java]:

...
else {
  conf.setMaxTaskParallelism(3);

  LocalCluster cluster = new LocalCluster();
  cluster.submitTopology("word-count", conf, builder.createTopology());

  Thread.sleep(10000); //<----- HERE

  cluster.shutdown();  //<----- HERE
}

答案 1 :(得分:3)

Storm 0.9.3 multi-lang不向后兼容,并且storm-starter中的WordCountTopology.java示例尚未针对更改进行更新。

  

除了Node.js实现之外,多语言协议在稳健性和错误处理能力方面得到了显着改进。因此,多语言API已经以非向后兼容的方式发生了变化。具有现有多语言拓扑的用户应参考Python,Ruby和JavaScript多语言示例,以确定升级前的影响。

答案 2 :(得分:2)

我有同样的问题,我还没有完整的解决方案,但错误源于python。 如果你看一下WordCountTopology类,你会看到内部类SplitSentence的以下构造函数:

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

如果你用Java代码替换它,即给这个类一个execute()方法,在那里进行String-splits,一切正常。

所以使用python的东西不起作用,虽然python代码工作并拆分字符串。希望这至少有一点帮助!

答案 3 :(得分:1)

正如@ booleys1012所说,这是因为当你运行mvn exec:java -Dstorm.topology = storm.starter.WordCountTopology并且没有给任何参数提交到集群时它会在LocalCluster中运行(模拟风暴集群用于测试拓扑结构)。这将持续10秒并调用cluster.shutdown(),这会导致它在您看到错误时抛出InterruptedException。预计这不是暴风雨的问题。

答案 4 :(得分:0)

我猜这个问题有点迟了,但我刚刚开始在macOS Sierra上使用Apache Storm,并发现在安装新版本时发生了这个错误。最后,我按照我发现的链接指示:

http://www.haroldnguyen.com/blog/category/storm/

所以,我安装了0.9.2版本,一切都像魅力一样!

PS。我也在Ubuntu 16.04上尝试过,并且效果很好。