【发布时间】:2016-03-10 06:54:32
【问题描述】:
我遵循了下面帖子中的示例
How to submit a topology in storm production cluster using IDE
Below is my implementation
TopologyBuilder builder = new TopologyBuilder();
Map storm_conf = Utils.readStormConfig();
storm_conf.put("nimbus.host", "localhost");
Nimbus.Client client = NimbusClient.getConfiguredClient(storm_conf)
.getClient();
String inputJar = "/home/user/TestType-1.0.jar";
NimbusClient nimbus = null;
try {
nimbus = new NimbusClient(storm_conf, "localhost", 6627);
} catch (TTransportException e) {
System.out.println("unable to connect to client");
e.printStackTrace();
}
System.setProperty("storm.jar", "/home/user/TestType-1.0.jar");
String jsonConf = JSONValue.toJSONString(storm_conf);
try {
nimbus.getClient().submitTopology("SellerPageTypeTopology",
"/home/user/TestType-1.0.jar", jsonConf, builder.createTopology());
} catch (AlreadyAliveException e) {
e.printStackTrace();
} catch (InvalidTopologyException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
我能够成功部署拓扑。在暴风雨 Ui 中,我能够看到拓扑处于活动状态,但缺少 spout 和 bolt 细节。知道我错过了什么。感谢您的帮助。
【问题讨论】:
标签: apache-storm