kafka-topics --delete --topic topic-name
--delete
: Specify the Topic to be deleted. --topic
: The name of the Topic to be deleted. kafka-topics --delete --topic my-topic
Q: How to delete a Topic with multiple partitions?
Answer: Use the --partitions
parameter to specify the number of partitions to be deleted. For example, to delete a Topic with 3 partitions, you can use the following command:
kafka-topics --delete --topic my-topic --partitions 3
Q: How to delete a Topic with multiple replicas?
Answer: Use the --replicas
parameter to specify the number of replicas to delete. For example, to delete a Topic with 2 replicas, you can use the following command:
kafka-topics --delete --topic my-topic --replicas 2
Q: How to delete a Topic with compression?
Answer: Use the --compression-type
parameter to specify the compression type to be deleted. For example, to delete a Topic with GZIP compression, you can use the following command:
kafka-topics --delete --topic my-topic --compression-type gzip
Q: How to delete a Topic with a retention policy?
Answer: Use the --retention-ms
parameter to specify the retention time to be deleted. For example, to delete a Topic with a retention time of 1 day, you can use the following command:
kafka-topics --delete --topic my-topic --retention-ms 86400000
Q: How to delete a Topic with a cleanup policy?
Answer: Use the --cleanup-policy
parameter to specify the cleanup policy to be deleted. For example, to delete a Topic with a deletion policy, you can use the following command:
kafka-topics --delete --topic my-topic --cleanup-policy delete
The above is the detailed content of A concise and easy-to-understand guide to deleting topics in Kafka. For more information, please follow other related articles on the PHP Chinese website!