---查看生成和消费队列的消息数量
kafka-run-class.bat kafka.tools.ConsumerOffsetChecker --topic test --zookeeper localhost:2181 --group test1
格式:kafka-run-class.bat kafka.tools.ConsumerOffsetChecker --topic 标题 --zookeeper 服务地址:端口 --group 消费组名称
[img]http://dl2.iteye.com/upload/attachment/0124/4228/aa3ffaf2-c1f3-3fd7-9c6e-19ab19a91526.png[/img]
topic:创建时topic名称
partition:分区编号
offset:表示该parition已经消费了多少条message
logSize:表示该partition已经写了多少条message
Lag:表示有多少条message没有被消费。
Owner:表示消费者
Created:该partition创建时间
Last Seen:消费状态刷新最新时间。
--- 创建标题()
kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test1
格式:kafka-topics.bat --create --zookeeper 服务地址:端口 --replication-factor 备份数量 --partitions 分区数 --topic 标题
--查看标题列表
kafka-topics.sh --list --zookeeper localhost:2181
kafka-topics.bat --list --zookeeper 服务地址:端口
--删除标题
Kafka 删除topic的命令是:
kafka-topics.bat --delete --zookeeper 【zookeeper server】 --topic 【topic name】
如果kafaka启动时加载的配置文件中server.properties没有配置delete.topic.enable=true
,那么此时的删除并不是真正的删除,而是把topic标记为:marked for deletion
[img]http://dl2.iteye.com/upload/attachment/0124/4226/d3c82d7d-b74f-34d4-a576-4fd3c2b28adb.png[/img]
--生产消息
kafka-console-producer.bat --broker-list localhost:9092 --topic test
kafka-console-producer.bat --broker-list kafka服务ip:9092 --topic 标题
---启动消费者,查看信息
kafka-console-consumer.bat --zookeeper localhost:2181 --topic test --from-beginning
kafka-console-consumer.bat --zookeeper 服务地址:端口 --topic 标题 --from-beginning
kafka-run-class.bat kafka.tools.ConsumerOffsetChecker --topic test --zookeeper localhost:2181 --group test1
格式:kafka-run-class.bat kafka.tools.ConsumerOffsetChecker --topic 标题 --zookeeper 服务地址:端口 --group 消费组名称
[img]http://dl2.iteye.com/upload/attachment/0124/4228/aa3ffaf2-c1f3-3fd7-9c6e-19ab19a91526.png[/img]
topic:创建时topic名称
partition:分区编号
offset:表示该parition已经消费了多少条message
logSize:表示该partition已经写了多少条message
Lag:表示有多少条message没有被消费。
Owner:表示消费者
Created:该partition创建时间
Last Seen:消费状态刷新最新时间。
--- 创建标题()
kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test1
格式:kafka-topics.bat --create --zookeeper 服务地址:端口 --replication-factor 备份数量 --partitions 分区数 --topic 标题
--查看标题列表
kafka-topics.sh --list --zookeeper localhost:2181
kafka-topics.bat --list --zookeeper 服务地址:端口
--删除标题
Kafka 删除topic的命令是:
kafka-topics.bat --delete --zookeeper 【zookeeper server】 --topic 【topic name】
如果kafaka启动时加载的配置文件中server.properties没有配置delete.topic.enable=true
,那么此时的删除并不是真正的删除,而是把topic标记为:marked for deletion
[img]http://dl2.iteye.com/upload/attachment/0124/4226/d3c82d7d-b74f-34d4-a576-4fd3c2b28adb.png[/img]
--生产消息
kafka-console-producer.bat --broker-list localhost:9092 --topic test
kafka-console-producer.bat --broker-list kafka服务ip:9092 --topic 标题
---启动消费者,查看信息
kafka-console-consumer.bat --zookeeper localhost:2181 --topic test --from-beginning
kafka-console-consumer.bat --zookeeper 服务地址:端口 --topic 标题 --from-beginning