Create a topic; partitions drive parallelism and replicas cannot exceed brokers
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic orders --partitions 3 --replication-factor 2Kafka 3.x operations reference: topic creation and partition scaling, console producer and consumer, consumer group lag and offset resets, throughput tests, plus bootstrap servers and log directories.
Create a topic; partitions drive parallelism and replicas cannot exceed brokers
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic orders --partitions 3 --replication-factor 2List all topics to confirm names before deeper debugging
kafka-topics.sh --bootstrap-server localhost:9092 --listShow partitions, replicas and ISR; fewer ISR members means lagging followers
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic ordersPartitions can only grow; increasing them changes key-based distribution
kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic orders --partitions 6Delete the topic and its data; requires delete.topic.enable
kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic ordersInteractive producer sending one message per line; exit with Ctrl+C
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic ordersProduce with keys like order-1:{"id":1} to keep per-key ordering
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic orders --property parse.key=true --property key.separator=:Consume history from the beginning; fine for debugging only on large topics
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic orders --from-beginningUse a consumer group and print key and partition to verify placement
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic orders --group debug-group --property print.key=true --property print.partition=truePassing --group commits offsets and can disturb production consumers.
List consumer groups before checking lag
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --listThe LAG column shows backlog; an empty CONSUMER-ID means no active consumer
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group order-serviceReset offsets to earliest after stopping the group to avoid conflicts
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group order-service --topic orders --reset-offsets --to-earliest --executeDelete a consumer group; only works when it has no active members
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --delete --group debug-groupProducer benchmark; throughput -1 is unthrottled and reports latency percentiles
kafka-producer-perf-test.sh --topic orders --num-records 100000 --record-size 1024 --throughput -1 --producer-props bootstrap.servers=localhost:9092 acks=1Consumer benchmark reporting MB/sec and message counts
kafka-consumer-perf-test.sh --topic orders --bootstrap-server localhost:9092 --messages 100000 --group perf-groupWithout --topic this summarizes all partitions and replica states
kafka-topics.sh --bootstrap-server localhost:9092 --describeInspect topic overrides such as retention.ms and cleanup.policy
kafka-configs.sh --bootstrap-server localhost:9092 --describe --entity-type topics --entity-name ordersShow log directory sizes per broker; the first stop for disk alerts
kafka-log-dirs.sh --bootstrap-server localhost:9092 --describe --topic-list ordersThis website uses cookies to ensure you get the best experience on our website. Privacy Policy.