1.启动storm的时候,报zookeeper NoNode for /brokers/topics/topic_test/partitions错误
就是说DynamicBrokersReader.getNumPartitions()里面,topicBrokersPath这个路径在zookeeper里面找不到,
topicBrokersPath = _zkPath + "/topics/" + _topic + "/partitions"
原因,kafka往该topic发送的数据过少,还未刷写磁盘,在zookeeper中还没有该path
2.kakfa-storm中,kafka消费zookeeper的节点的设定
SpoutConfig.zkServers赋值设定,如果未设定,则默认使用storm的zk节点。
KafkaSpout.open()中关于zk的设定如下,
List<String> zkServers = _spoutConfig.zkServers;
if (zkServers == null) {
zkServers = (List<String>) conf.get(Config.STORM_ZOOKEEPER_SERVERS);
}
相关的,kafka broker的节点设定为KafkaConfig.BrokerHosts hosts变量
设定例子
BrokerHosts hosts = new ZkHosts(“IP1:PORT,IP2:PORT,IP3:PORT”);
SpoutConfig spoutConf = new SpoutConfig(hosts, topic_name, zkRoot, id);