bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --delete-config retention.ms
bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic mytopic
bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -1 --offsets 1 | awk -F ":" '{sum += $3} END {print sum}'
bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -2
bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -1
bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic mytopic --from-beginning
bin/kafka-consumer-offset-checker.sh --zookeeper=localhost:2181 --topic=mytopic --group=my_consumer_group
Add the following property to config/consumer.properties
:
exclude.internal.topics=false
bin/kafka-console-consumer.sh --consumer.config config/consumer.properties --from-beginning --topic __consumer_offsets --zookeeper localhost:2181 --formatter "kafka.coordinator.GroupMetadataManager\$OffsetsMessageFormatter"
bin/kafka-consumer-groups.sh --zookeeper localhost:2181 --list
(old api)
bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server localhost:9092 --list
(new api)
bin/kafka-consumer-groups.sh --zookeeper localhost:2181 --describe --group <group name>
kafkacat -C -b localhost:9092 -t mytopic -p 0 -o -5 -e
bin/zookeeper-shell.sh localhost:2181
PLAIN versus PLAINTEXT: Do not confuse the SASL mechanism PLAIN with the no TLS/SSL encryption option, which is called PLAINTEXT. Configuration parameters such as
sasl.enabled.mechanisms
orsasl.mechanism.inter.broker.protocol
may be configured to use the SASL mechanism PLAIN, whereassecurity.inter.broker.protocol
or listeners may be configured to use the no TLS/SSL encryption option, SASL_PLAINTEXT.