赞
踩
Kafka 选择了第二种方案,原因如下:
2.虽然第二种方案的网络延迟会比较高,但网络延迟对 Kafka 的影响较小。
(1)修改配置文件 consumer.properties
exclude.internal.topics=false
(2)读取 offset
- bin/kafka-console-consumer.sh --topic __consumer_offsets --
- zookeeper hadoop102:2181 --formatter
- "kafka.coordinator.GroupMetadataManager\$OffsetsMessageFormatter"
- --consumer.config config/consumer.properties --from-beginning
- bin/kafka-console-consumer.sh --topic __consumer_offsets --
- zookeeper hadoop102:2181 --formatter
- "kafka.coordinator.group.GroupMetadataManager\$OffsetsMessageForm
- atter" --consumer.config config/consumer.properties --frombeginning
- [atguigu@hadoop103 config]$ vi consumer.properties
- group.id=atguigu
- [atguigu@hadoop102 kafka]$ bin/kafka-console-consumer.sh \
- --zookeeper hadoop102:2181 --topic first --consumer.config
- config/consumer.properties
- [atguigu@hadoop103 kafka]$ bin/kafka-console-consumer.sh --
- bootstrap-server hadoop102:9092 --topic first --consumer.config
- config/consumer.properties
- [atguigu@hadoop104 kafka]$ bin/kafka-console-producer.sh \
- --broker-list hadoop102:9092 --topic first
- >hello world
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。