Common Operations of Kafka0.8.1

Source: Internet
Author: User
The versions of Kafka vary greatly. The following is the 0.8.1 operation method. First, cd to the bin directory of kafaka, where all the tools used to operate kafka are located. If the kafka version cannot be found or the name is incorrect, the kafka version is incorrect. Take topic as an example-change the ip address after zookeeper to your own topic. kafka-topics.sh-topict

The versions of Kafka vary greatly. The following is the 0.8.1 operation method. First, cd to the bin directory of kafaka, where all the tools used to operate kafka are located. If the kafka version cannot be found or the name is incorrect, the kafka version is incorrect. Take the topic as an example-change the ip address after zookeeper to your own topic./kafka-topics.sh-topic t

The versions of Kafka vary greatly. The following is the operation method of 0.8.1.

First, cd to the bin directory of kafaka. All the tools for operating kafka are here. If the kafka version cannot be found or the name is incorrect, the kafka version is incorrect.

Take topic as an Example
-Change the ip address after zookeeper to your own

Create a topic
./Kafka-topics.sh-topic test-create-partitions 2-replication-factor 1-zookeeper 10.234.10.17: 2181, 10.234.10.20: 2181
Partitions are the number of partitions. The default value of 0.8.1 is 2.
Replication-factor: indicates the replication factor, that is, the number of copies.

View all topics
./Kafka-topics.sh-list-zookeeper 10.234.10.17: 2181, 10.234.10.20: 2181

Delete a topic
./Kafka-topics.sh-topic test-delete-zookeeper 10.234.10.17: 2181, 10.234.10.20: 2181

View topic details
./Kafka-topics.sh-topic test-describe-zookeeper 10.234.10.17: 2181, 10.234.10.20: 2181

View unavailable partitions
./Kafka-topics.sh-topic test-describe-unavailable-partitions-zookeeper 10.234.10.17: 2181, 10.234.10.20: 2181
If you do not know the cause, some partitions may become unavailable. You can use this command to check the cause.

Original article address: Kafka0.8.1 common operations. Thank you for sharing them with me.

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.