Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 611 Bytes

topic.rst

File metadata and controls

22 lines (15 loc) · 611 Bytes

Topic

topic 相关操作

# 创建 topic
./kafka-topics.sh --create --zookeeper localhost:2181/kafka --replication-factor 1 --partitions 1 --topic test

# 列出所有 topic
./kafka-topics.sh --zookeeper localhost:2181/kafka --list

# 查看 topic
./kafka-topics.sh --zookeeper localhost:2181 --describe --topic test

# 增加分区数量 (分区只能增加不能减少)
./kafka-topics.sh --zookeeper localhost:2181 --alter --topic test --partitions 4

# 删除 topic
./kafka-topics.sh --zookeeper localhost:2181 --delete --topic test