./kafka-topics --zookeeper localhost:2181 --list
./kafka-topics --zookeeper localhost:2181 --describe --topic mytopic
./kafka-topics --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
./kafka-topics --zookeeper localhost:2181 --alter --topic mytopic --delete-config retention.ms
./kafka-topics --zookeeper localhost:2181 --delete --topic mytopic
./kafka-run-class kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -1 --offsets 1 | awk -F ":" '{sum += $3} END {print sum}'
./kafka-run-class kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -2
./kafka-run-class kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -1
./kafka-console-consumer --new-consumer --bootstrap-server localhost:9092 --topic mytopic --from-beginning
./kafka-consumer-offset-checker --zookeeper=localhost:2181 --topic=mytopic --group=my_consumer_group
Add the following property to config/consumer.properties
:
exclude.internal.topics=false
./kafka-console-consumer --consumer.config config/consumer.properties --from-beginning --topic __consumer_offsets --zookeeper localhost:2181 --formatter "kafka.coordinator.GroupMetadataManager\$OffsetsMessageFormatter"
./kafka-consumer-groups --zookeeper localhost:2181 --list
(old api)
./kafka-consumer-groups --new-consumer --bootstrap-server localhost:9092 --list
(new api)
./kafka-consumer-groups --zookeeper localhost:2181 --describe --group <group name>
./kafkacat -C -b localhost:9092 -t mytopic -p 0 -o -5 -e
./zookeeper-shell localhost:2181