Collating Kafka related common command management
# # Create Themes (4 partitions, 2 replicas)
bin/kafka-topics.sh--create--zookeeper localhost:2181--replication-factor 2--partitions 4-- Topic test
Query
# # Query Cluster description
bin/kafka-topics.sh--describe--zookeeper
# New Consumer list query (support 0.9 version +)
bin/ kafka-consumer-groups.sh--new-consumer--bootstrap-server localhost:9092--list
# Displays consumption details for a consumer group (only supports offset storage on zookeeper)
bin/kafka-run-class.sh Kafka.tools.ConsumerOffsetChecker--zkconnect localhost:2181--group Test
# # shows consumption details for a consumer group (support version 0.9 +)
bin/kafka-consumer-groups.sh--new-consumer- Bootstrap-server localhost:9092--describe--group test-consumer-group
send and Consume
# # producer
bin/kafka-console-producer.sh--broker-list localhost:9092--topic Test
# # Consumer
bin/ kafka-console-consumer.sh--zookeeper localhost:2181--topic Test
# New producer (Support 0.9 version +)
bin/ kafka-console-producer.sh--broker-list localhost:9092--topic test--producer.config config/producer.properties
# # New Consumer (Support 0.9 version +)
bin/kafka-console-consumer.sh--bootstrap-server localhost:9092--topic test-- New-consumer--from-beginning--consumer.config config/consumer.properties
# # Advanced point usage
bin/ kafka-simple-consumer-shell.sh--brist localhost:9092--topic Test--partition 0--offset 1234 --max-messages 10
Balance leader
bin/kafka-preferred-replica-election.sh--zookeeper Zk_host:port/chroot
Kafka self-belt pressure test command
bin/kafka-producer-perf-test.sh--topic Test--num-records--record-size 1--throughput bootstrap.servers=localhost:9092
Author: Orcs
Link: http://orchome.com/454
Source: Orchome
Copyright belongs to the author. Commercial reprint please contact the author to obtain authorization, non-commercial reprint please indicate the source.