查看topic列表
bin/kafka-topics.sh --bootstrap-server localhost:9093 --list
创建topic
bin/kafka-topics.sh --create --zookeeper sf01.tendcloud.com:2181 --replication-factor 2 --partitions 2 --topic fl0316
查看offset
bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9093 --topic fl0316
查看分区详情
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic fl0316
生产数据
bin/kafka-console-producer.sh --broker-list localhost:9093 --topic fl0316
消费数据
bin/kafka-console-consumer.sh --bootstrap-server localhost:9093 --consumer-property group.id=fl0315-c --topic fl0316
新增topic的partitions
bin/kafka-topics.sh --alter --zookeeper localhost:2181 --partitions 5 --topic fl0316
自动分区
bin/kafka-reassign-partitions.sh --zookeeper localhost:2181 --topics-to-move-json-file topic-to-move.json --broker-list “0,1,2,3” --generate
执行分区
bin/kafka-reassign-partitions.sh --zookeeper localhost:2181 --reassignment-json-file p.json --execute
确认分区信息
bin/kafka-reassign-partitions.sh --zookeeper localhost:2181 --reassignment-json-file p.json --verify
删除topic
bin/kafka-topics.sh --delete --zookeeper localhost:2181 --topic fl0316
Kafka基本使用(二)
原创
©著作权归作者所有:来自51CTO博客作者独孤飞磊的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:Java基础-循环实例
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
使用Kafka结合Odoo实现数据同步
kafka与odoo结合
json kafka bootstrap -
kafka基本命令使用
kafka操作
kafka 命令使用 -
kafka基本命令,python-kafka使用
kafka使用
kafka基本命令使用 python-kafka -
Maxwell基本使用二
实时数仓
mysql 数据 kafka -
kafka for java 简单使用(二)
本文简单的介绍 kafka在java 环境下的 连接和使用方法
java 后端 kafka apache 消息发送 -
spring 切面添加请求参数
1 、声明一个切面 在基于AOP命名空间的Spring AOP中,要声明一个切面,需要使用<aop:config/>的子标签<aop:aspect>。<aop:aspect>标签有一个ref属性必须被赋值,它用于指定和该切面关联的受管Bean
spring 切面添加请求参数 aop spring bean encoding