Collating Kafka related common commands

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.