java - 异常: submitTopology failed: out of sequence response

标签 java eclipse jar apache-storm

我运行一些java代码,它将上传:storm-starter-topologies-0.9.6.jar 从示例中,控制台显示:

535 [main] INFO backtype.storm.StormSubmitter - Uploading topology jar C:\apachestorm096\examples\storm-starter\storm-starter-topologies-0.9.6.jar to assigned location: ¨/usr/local/storm/data¨/nimbus/inbox/stormjar-8b5acdaf-e6ce-4b01-9ea9-9bd92e30f417.jar

1066 [main] INFO backtype.storm.StormSubmitter - Successfully uploaded topology jar to assigned location: ¨/usr/local/storm/data¨/nimbus/inbox/stormjar-8b5acdaf-e6ce-4b01-9ea9-9bd92e30f417.jar

但我也收到一个错误:

Exception in thread "main" org.apache.thrift7.TApplicationException: submitTopology failed: out of sequence response

在storm UI中显示提交的拓扑... 但什么也没有发生,没有溪流,没有喷口,没有 bolt ……没有 worker …… Eclipse在本地运行,storm+zookeeper在虚拟机上运行。

这是代码:

  TopologyBuilder builder = new TopologyBuilder();
  Config conf = new Config();
  conf.put(Config.NIMBUS_HOST, "100.0.0.26");
  conf.put(Config.STORM_ZOOKEEPER_PORT, "2181");

  conf.setNumWorkers(20);
  conf.setMaxSpoutPending(5000);
  
  StormSubmitter submitter = new StormSubmitter();
  conf.setDebug(true);
  Map storm_conf = Utils.readStormConfig();
  storm_conf.put("nimbus.host", "100.0.0.26");
  Client client = NimbusClient.getConfiguredClient(storm_conf).getClient();
  try {
      NimbusClient nimbus = new NimbusClient(storm_conf, "100.0.0.26", 6627);
  
  
  //submitter.submitTopology("blub", conf, builder.createTopology());
  
  String inputJar = "C:\\apachestorm096\\examples\\storm-starter\\storm-starter-topologies-0.9.6.jar";
  // upload topology jar to Cluster using StormSubmitter
 String uploadedJarLocation = StormSubmitter.submitJar(storm_conf,inputJar);
 
 System.out.println("Try ... ");
 try {
     
      String jsonConf = JSONValue.toJSONString(storm_conf);
      System.out.println("Config : " + jsonConf );
      
      nimbus.getClient().send_getNimbusConf();
      Thread.sleep(5000);
      System.out.println("Out of sleep ... ");
      nimbus.getClient().submitTopology("word-count", uploadedJarLocation, jsonConf, builder.createTopology());

      
  } catch (AlreadyAliveException e) {  // (AlreadyAliveException ae) {
      e.printStackTrace();
  }

最佳答案

由于设置的配置参数太少而引发错误。 我忘记设置 NIMBUS_THRIFT_PORT,我还更改了配置的定义方式...

  TopologyBuilder builder = new TopologyBuilder();
  Map conf = new HashMap();
  //Map conf = Utils.readStormConfig();
  conf.put(Config.NIMBUS_HOST, "100.0.0.26");
  conf.put(Config.NIMBUS_THRIFT_PORT , 6627 );
  conf.put(Config.STORM_ZOOKEEPER_PORT, 2181 );
  conf.put(Config.TOPOLOGY_WORKERS , 4);

  conf.put("storm.thrift.transport", "backtype.storm.security.auth.SimpleTransportPlugin");

关于java - 异常: submitTopology failed: out of sequence response,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34473864/

相关文章:

java - 如何在 Google 应用引擎中设置 Unicode?

java - 在 joda time 中创建自定义日历

linux - 在 Unix 中从 EAR 文件中提取特定类文件

java - 无效或损坏的 jarFile

java - 解决 Java 中的运行时依赖关系

java - 为什么Java中的浮点计算比C慢

java - @TableGenerator 可以保存表中最后使用的 id 而不是下一个可用的 id 吗?

java - 在项目 xxx 的构建路径中检测到循环 - 构建路径问题

java - Eclipse 插件项目 "checkstyle internal error"说 "cannot initialize module TreeWalker - Unable to instantiate ' ...ForbidCertainImportsCheck'"

eclipse - 仅显示 Eclipse CDT 中的编译错误