如何设置参数" zkRoot"在SpoutConfig中

时间:2018-06-13 03:01:26

标签: apache-kafka apache-zookeeper apache-storm

当我尝试以本地模式开发storm-kafka时,我收到了以下信息:

  

50010 [ProcessThread(sid:0 cport:-1):] INFO   o.a.s.s.o.a.z.s.PrepRequestProcessor - 获得用户级KeeperException   处理sessionid时:0x163f707a19f0013输入:create cxid:0x3   zxid:0x59 txntype:-1 reqpath:不适用错误路径:/ tmp / test / KafkaSpout   错误:KeeperErrorCode = / tmp / test / KafkaSpout的NoNode

它似乎与SpoutConfig中的参数有关 这是我的代码:

BrokerHosts hosts = new ZkHosts("localhost:2181");
SpoutConfig spoutConfig = new SpoutConfig(hosts, topicName, "/tmp/test", "KafkaSpout");
spoutConfig.scheme = new SchemeAsMultiScheme(new StringScheme());

builder.setSpout("KafkaSpout", new KafkaSpout(spoutConfig), 2);

所以如何正确设置zkRoot

0 个答案:

没有答案