Command Line Tools
Download Apache Kafka Binary Package
-
Download the kafka_2.13-2.6.1.tgz binary package.
-
Decompress
tar -xzvf kafka_2.13-2.6.1.tgz
-
Enter the command line directory
cd kafka_2.13-2.6.1/bin
Basic Operations
- Please first create a Topic:
test-topic
on the console, refer to: Topic Creation- In actual execution, please replace the following address with the access address of your UKafka cluster, refer to: View Access Point.
- Topic List
./kafka-topics.sh --bootstrap-server 10.9.188.159:9092 --list
- View Topic Details
./kafka-topics.sh --bootstrap-server 10.9.188.159:9092 --describe --topic test-topic
- Send Message
./kafka-console-producer.sh --bootstrap-server 10.9.188.159:9092 --topic test-topic
- Receive Message
./kafka-console-consumer.sh --bootstrap-server 10.9.188.159:9092 --topic test-topic --group test-group --from-beginning
- Consumer Group List
Do not exit the receive message command, open another terminal and execute the following command
./kafka-consumer-groups.sh --bootstrap-server 10.9.188.159:9092 --list
- Consumer Group Details
./kafka-consumer-groups.sh --bootstrap-server 10.9.188.159:9092 --describe --group test-group
- Delete Consumer Group
./kafka-consumer-groups.sh --bootstrap-server 10.9.188.159:9092 --delete --group test-group