創(chuàng)建一個(gè)kafka主題名為intsmazX,指定分區(qū)數(shù)為3.
使用kafkaspout創(chuàng)建該主題的消費(fèi)者實(shí)例(指定元數(shù)據(jù)存放zookeeper中的路徑為/kafka-offset,指定實(shí)例id為onetest),啟動(dòng)storm可以觀察到如下信息:
INFO storm.kafka.ZkCoordinator - Task [1/1] Refreshing partition manager connections INFO storm.kafka.DynamicBrokersReader - Read partition info from zookeeper: GlobalPartitionInformation{partitionMap={0=hadoop002.icccuat.com:6667, 1=hadoop003.icccuat.com:6667, 2=hadoop001.icccuat.com:6667}} INFO storm.kafka.KafkaUtils - Task [1/1] assigned [Partition{host=hadoop002.icccuat.com:6667, partition=0}, Partition{host=hadoop003.icccuat.com:6667, partition=1}, Partition{host=hadoop001.icccuat.com:6667, partition=2}] INFO storm.kafka.ZkCoordinator - Task [1/1] Deleted partition managers: [] INFO storm.kafka.ZkCoordinator - Task [1/1] New partition managers: [Partition{host=hadoop002.icccuat.com:6667, partition=0}, Partition{host=hadoop003.icccuat.com:6667, partition=1}, Partition{host=hadoop001.icccuat.com:6667, partition=2}] INFO storm.kafka.PartitionManager - Read partition information from: /kafka-offset/onetest/partition_0 --> null //這個(gè)地方會(huì)到zookeeper中該目錄下讀取,看是否存儲(chǔ)有對該分區(qū)的消費(fèi)信息INFO storm.kafka.PartitionManager - No partition information found,