我本来想创建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);
1条答案
按热度按时间lmvvr0a81#
尝试从根目录中删除“/”
String zkRoot = "stormffbkafka";
谢谢。