未创建根

djmepvbi  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(294)

我本来想创建storm kafka拓扑,但是喷口从kafka repeatable读取数据,我发现zkroot没有创建。有人知道原因吗?

String brokerZkStr = "192.168.2.125:2181";
String topic = "topic_kafka";
String zkRoot = "/stormffbkafka";
String id = "kafka-word";
TopologyBuilder builder = new TopologyBuilder();
BrokerHosts hosts = new ZkHosts(brokerZkStr);
SpoutConfig spoutConfig = new SpoutConfig(hosts, topic, zkRoot, id);

spoutConfig.scheme = new SchemeAsMultiScheme(new StringScheme());
spoutConfig.zkServers=new ArrayList<String>(Arrays.asList("192.168.2.125"));
spoutConfig.zkPort = 2181;
KafkaSpout kafkaSpout = new KafkaSpout(spoutConfig);
lmvvr0a8

lmvvr0a81#

尝试从根目录中删除“/” String zkRoot = "stormffbkafka"; 谢谢。

相关问题