异常:submittopology失败:无序响应

yuvru6vn  于 2021-06-21  发布在  Storm
关注(0)|答案(1)|浏览(237)

我运行了一些java代码,它会上传示例中的:storm-starter-topologies-0.9.6.jar,控制台显示:
535[main]info backtype.storm.stormsubmitter-将拓扑jar c:\apachestorm096\examples\storm starter\storm-starter-topologies-0.9.6.jar上载到指定位置:¨/usr/本地/风暴/数据¨/nimbus/inbox/stormjar-8b5acdaf-e6ce-4b01-9ea9-9bd92e30f417.jar
1066[main]info backtype.storm.stormsubmitter-已成功将拓扑jar上载到指定位置:¨/usr/本地/风暴/数据¨/nimbus/inbox/stormjar-8b5acdaf-e6ce-4b01-9ea9-9bd92e30f417.jar
但我也有一个错误:
线程“main”org.apache.thrift7.tapplicationexception中出现异常:submittopology失败:响应顺序错误
在storm ui中显示提交的拓扑。。。但是什么都没有发生,没有溪流,没有喷口,没有 lightning 。。。没有工人。。。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();
  }
68de4m5k

68de4m5k1#

由于设置的配置参数太少,因此引发错误。我忘了设置nimbus\u thrift\u端口,我还更改了配置的定义方式。。。

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");

相关问题