2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-19 03:25:44 +00:00
cheat.sheets/sheets/kafka-topics

19 lines
509 B
Plaintext
Raw Normal View History

2019-06-14 08:06:50 +00:00
# kafka-topics
#
# Comamnd-line tool to manage Kafka topics
# list topics
kafka-topics --zookeeper localhost:2181 --list
# create a topic
kafka-topics --zookeeper localhost:2181 --create --topic logs --partitions 3 --replication-factor 2
# view topic
kafka-topics --zookeeper localhost:2181 --describe --topic logs
# update a topic
kafka-topics --zookeeper localhost:2181 --alter --topic logs --config cleanup.policy=compact
# delete a topic
kafka-topics --zookeeper localhost:2181 --delete --topic logs