我运行一些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/