<InvalidTopologyException InvalidTopologyException (msg: The storm.zookeeper.servers field must be Iterable from java.lang.String)>

I took a sample word code and tried to send to a remote nimbus server without sending to LocalCluster. I used the following client side code and the following yaml config, server and ZK are started separately.

When I submit using the below client side code, I get the following error when I run the file. / storm jar file / path / jar-file.jar

ut.pending":5000,"storm.zookeeper.servers":"149.160.221.43","topology.max.task.parallelism":3}
308  [main] WARN  backtype.storm.StormSubmitter - Topology submission exception: Field     storm.zookeeper.servers must be an Iterable of java.lang.String
Exception in thread "main" InvalidTopologyException(msg:Field storm.zookeeper.servers must be an Iterable of java.lang.String)
at backtype.storm.generated.Nimbus$submitTopology_result.read(Nimbus.java:2466)
at org.apache.thrift7.TServiceClient.receiveBase(TServiceClient.java:78)
at backtype.storm.generated.Nimbus$Client.recv_submitTopology(Nimbus.java:162)
at backtype.storm.generated.Nimbus$Client.submitTopology(Nimbus.java:146)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:98)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:58)
at storm.starter.WordCountTopology.main(WordCountTopology.java:110)

      

Building topology code:

System.setProperty("storm.jar","/Users/lginnali/work/airavata/storm/storm/examples/storm-starter/target/storm-starter-0.10.0-SNAPSHOT.jar");
TopologyBuilder builder = new TopologyBuilder();

builder.setSpout("spout", new RandomSentenceSpout(), 5);

BoltDeclarer split = builder.setBolt("split", new SplitSentence(), 8);
split.shuffleGrouping("spout");
builder.setBolt("count", new WordCount(), 12).fieldsGrouping("split", new Fields("word"));

Config conf = new Config();
conf.put(Config.NIMBUS_HOST, "localhost");
conf.put(Config.NIMBUS_THRIFT_PORT,6627);
conf.put(Config.STORM_ZOOKEEPER_PORT,2181);
conf.put(Config.STORM_ZOOKEEPER_SERVERS,"localhost");
conf.setNumWorkers(20);
conf.setMaxSpoutPending(5000);


if (args != null && args.length > 0) {
    conf.setNumWorkers(3);

    StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
}

      

sample storm.yaml looks like this file.

https://github.com/apache/storm/blob/master/conf/defaults.yaml

+3


source to share


2 answers


Exactly what the exception says: Config.STORM_ZOOKEEPER_SERVERS should be an iterable of strings, not a string. So try replacing

conf.put(Config.STORM_ZOOKEEPER_SERVERS,"localhost");

      



from

conf.put(Config.STORM_ZOOKEEPER_SERVERS, Arrays.asList(new String[]{"localhost"}));

      

+1


source


The problem may be due to an error in the storm.yaml file, make sure the entry for storm.zookeeper.server is in the following format: storm.zookeeper.server: (space) - (space) "ip-address". ie, there must be a space between hyphens and ip-address, and also from the beginning of a new line.



+1


source







All Articles