kafka + storm 整合原始碼案例
kafka-storm-starter是一個展示如何實現Apache Kafka與Apache Storm的整合案例,使用Apache Avro作為資料序列化。
執行$ ./sbt test
可以對 Kafka Storm和Kafka-Storm 整合進行端到端的測試。
執行$./sbt run
這個命令是載入執行KafkaStormDemo,這個演示原始碼能夠在記憶體中啟動ZooKeeper Kafka和Storm例項,然後執行Storm topology 連線和讀取Kafka例項。
會看到如下輸出:
7031 [Thread-19] INFO backtype.storm.daemon.worker - Worker 3f7f1a51-5c9e-43a5-b431-e39a7272215e for storm kafka-storm-starter-1-1400839826 on daa60807-d440-4b45-94fc-8dd7798453d2:1027 has finished loading
7033 [Thread-29-kafka-spout] INFO storm.kafka.DynamicBrokersReader - Read partition info from zookeeper: GlobalPartitionInformation{partitionMap={0=127.0.0.1:9092}}
7050 [Thread-29-kafka-spout] INFO backtype.storm.daemon.executor - Opened spout kafka-spout:(1)
7051 [Thread-29-kafka-spout] INFO backtype.storm.daemon.executor - Activating spout kafka-spout:(1)
7051 [Thread-29-kafka-spout] INFO storm.kafka.ZkCoordinator - Refreshing partition manager connections
7065 [Thread-29-kafka-spout] INFO storm.kafka.DynamicBrokersReader - Read partition info from zookeeper: GlobalPartitionInformation{partitionMap={0=127.0.0.1:9092}}
7066 [Thread-29-kafka-spout] INFO storm.kafka.ZkCoordinator - Deleted partition managers: []
7066 [Thread-29-kafka-spout] INFO storm.kafka.ZkCoordinator - New partition managers: [Partition{host=127.0.0.1:9092, partition=0}]
7083 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Read partition information from: /kafka-spout/kafka-storm-starter/partition_0 --> null
7100 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - No partition information found, using configuration to determine offset
7105 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Starting Kafka 127.0.0.1:0 from offset 18
7106 [Thread-29-kafka-spout] INFO storm.kafka.ZkCoordinator - Finished refreshing
7126 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Committing offset for Partition{host=127.0.0.1:9092, partition=0}
7126 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Committed offset 18 for Partition{host=127.0.0.1:9092, partition=0} for topology: 47e82e34-fb36-427e-bde6-8cd971db2527
9128 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Committing offset for Partition{host=127.0.0.1:9092, partition=0}
9129 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Committed offset 18 for Partition{host=127.0.0.1:9092, partition=0} for topology: 47e82e34-fb36-427e-bde6-8cd971db2527
這表示Storm已經連線上Kafka。
更多見專案github
執行$ ./sbt test
可以對 Kafka Storm和Kafka-Storm 整合進行端到端的測試。
執行$./sbt run
這個命令是載入執行KafkaStormDemo,這個演示原始碼能夠在記憶體中啟動ZooKeeper Kafka和Storm例項,然後執行Storm topology 連線和讀取Kafka例項。
會看到如下輸出:
7031 [Thread-19] INFO backtype.storm.daemon.worker - Worker 3f7f1a51-5c9e-43a5-b431-e39a7272215e for storm kafka-storm-starter-1-1400839826 on daa60807-d440-4b45-94fc-8dd7798453d2:1027 has finished loading
7033 [Thread-29-kafka-spout] INFO storm.kafka.DynamicBrokersReader - Read partition info from zookeeper: GlobalPartitionInformation{partitionMap={0=127.0.0.1:9092}}
7050 [Thread-29-kafka-spout] INFO backtype.storm.daemon.executor - Opened spout kafka-spout:(1)
7051 [Thread-29-kafka-spout] INFO backtype.storm.daemon.executor - Activating spout kafka-spout:(1)
7051 [Thread-29-kafka-spout] INFO storm.kafka.ZkCoordinator - Refreshing partition manager connections
7065 [Thread-29-kafka-spout] INFO storm.kafka.DynamicBrokersReader - Read partition info from zookeeper: GlobalPartitionInformation{partitionMap={0=127.0.0.1:9092}}
7066 [Thread-29-kafka-spout] INFO storm.kafka.ZkCoordinator - Deleted partition managers: []
7066 [Thread-29-kafka-spout] INFO storm.kafka.ZkCoordinator - New partition managers: [Partition{host=127.0.0.1:9092, partition=0}]
7083 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Read partition information from: /kafka-spout/kafka-storm-starter/partition_0 --> null
7100 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - No partition information found, using configuration to determine offset
7105 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Starting Kafka 127.0.0.1:0 from offset 18
7106 [Thread-29-kafka-spout] INFO storm.kafka.ZkCoordinator - Finished refreshing
7126 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Committing offset for Partition{host=127.0.0.1:9092, partition=0}
7126 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Committed offset 18 for Partition{host=127.0.0.1:9092, partition=0} for topology: 47e82e34-fb36-427e-bde6-8cd971db2527
9128 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Committing offset for Partition{host=127.0.0.1:9092, partition=0}
9129 [Thread-29-kafka-spout] INFO storm.kafka.PartitionManager - Committed offset 18 for Partition{host=127.0.0.1:9092, partition=0} for topology: 47e82e34-fb36-427e-bde6-8cd971db2527
這表示Storm已經連線上Kafka。
更多見專案github
相關文章
- Storm 系列(九)—— Storm 整合 KafkaORMKafka
- Storm與kafka整合ORMKafka
- Storm系列(六)storm和kafka整合ORMKafka
- storm kafka外掛使用案例ORMKafka
- storm(1.1.3)與kafka(1.0.0)整合ORMKafka
- SpringBoot整合Kafka和StormSpring BootKafkaORM
- Spring boot 整合Kafka+StormSpring BootKafkaORM
- Kafka實戰-Kafka到StormKafkaORM
- kafka+storm+hbaseKafkaORM
- Storm-原始碼分析-metricORM原始碼
- storm-kafka-client使用ORMKafkaclient
- Kafka實戰-Storm ClusterKafkaORM
- storm與kafka結合ORMKafka
- Storm-原始碼分析-hook(backtype.storm.hooks)ORM原始碼Hook
- Kafka 原始碼剖析Kafka原始碼
- Kafka原始碼分析Kafka原始碼
- Storm-原始碼分析-Thrift的使用ORM原始碼
- Kafka之Producer原始碼Kafka原始碼
- Kafka 原始碼剖析(一)Kafka原始碼
- Storm-原始碼分析-timer(backtype.storm.timer)ORM原始碼
- Storm的BaseBasicBolt原始碼解析ack機制ORM原始碼
- Storm-原始碼分析-Multimethods使用例子ORM原始碼
- Storm-原始碼分析-TopologySubmit-TaskORM原始碼MIT
- 新版flume+kafka+storm安裝部署KafkaORM
- 【Twitter Storm系列】flume-ng+Kafka+Storm+HDFS 實時系統搭建ORMKafka
- 原始碼分析Kafka之Producer原始碼Kafka
- Kafka Eagle 原始碼解讀Kafka原始碼
- flume+kafka+storm+mysql架構設計KafkaORMMySql架構
- Storm-原始碼分析-TopologySubmit-Task-TopologyContext(backtype.storm.task)ORM原始碼MITContext
- apache kafka原始碼分析-Producer分析ApacheKafka原始碼
- Apache Camel與Spring-boot和Kafka的整合開源案例ApacheSpringbootKafka
- TensorFlow案例原始碼原始碼
- Kafka實時流資料經Storm至HdfsKafkaORM
- 大資料6.1 - 實時分析(storm和kafka)大資料ORMKafka
- kafka原始碼剖析(二)之kafka-server的啟動Kafka原始碼Server
- kafka入門案例Kafka
- Flink kafka source & sink 原始碼解析Kafka原始碼
- Kafka原始碼分析(二) - 生產者Kafka原始碼