apache-storm – storm-starter示例拓扑崩溃

我刚开始使用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

任何帮助将不胜感激.

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

参见[./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
}

转载注明原文:apache-storm – storm-starter示例拓扑崩溃 - 代码日志