我可以通过Nimbus客户端将我的jar提交到Nimbus运行的远程服务器。
我可以看到风暴ui上的拓扑条目,但是,我在下一页看不到喷口和螺栓细节。此外,没有调用任何生命周期方法。
我怀疑jar中的拓扑主方法没有被调用,因为我没有在配置中的任何地方指定类名。
如果我直接通过命令行部署它,即./storm jar#jar##classname#。
如果您注意到风暴ui,则拓扑名称取自Nimbus客户端提交者,而不是拓扑类中给出的名称。
TopologyBuilder builder = new TopologyBuilder();
Map storm_conf = Utils.readStormConfig();
storm_conf.put("nimbus.host", "<hostname>");
String inputJar = "C:/Users/MY-TOPOLOGY-1.0.0-SNAPSHOT.jar";
NimbusClient nimbus = new NimbusClient(storm_conf, "<hostname>",6627);
String uploadedJarLocation = StormSubmitter.submitJar(storm_conf,inputJar);
String jsonConf = JSONValue.toJSONString(storm_conf);
nimbus.getClient().submitTopology("central-cache",uploadedJarLocation, jsonConf, builder.createTopology());
System.out.println("Topology submitted");
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("spout1", new MySpout(), 3);
builder.setBolt("bolt1",new MyBoltOne(),3).setNumTasks(3).shuffleGrouping("spout1");
builder.setBolt("bolt2",new MyBoltTwo(),3).setNumTasks(3).shuffleGrouping("bolt1");
Config conf = new Config();
conf.setNumWorkers(3);
conf.setDebug(true);
StormSubmitter.submitTopology("central-cache-topology",conf,builder.createTopology());
META-INF / MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: <<author>>
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_45
Main-Class: com.gooe.ews.storm.CentralCacheTopology
Storm UI屏幕截图