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.