kafka刪除topic后再創建同名的topic報錯(ERROR org.apache.kafka.common.errors.TopicExistsException)


[hadoop@datanode3 logs]$ kafka-topics.sh --delete --zookeeper datanode1:2181 --topic first
Topic first is marked for deletion.
Note: This will have no impact if delete.topic.enable is not set to true.

 

[hadoop@datanode3 logs]$ kafka-topics.sh  --create --zookeeper datanode1:2181 --partitions 2 --replication-factor 3 --topic first

Error while executing topic command : Topic 'first' already exists.

[2019-07-13 07:11:05,073] ERROR org.apache.kafka.common.errors.TopicExistsException: Topic 'first' already exists.

 (kafka.admin.TopicCommand$)

 

 

報錯原因是我當時kafka-console-producer.sh和kafka-console-consumer.sh都還在運行,刪除只刪除了部分patition

后來關掉kafka-console-producer.sh和kafka-console-consumer.sh進程后,再刪除,再創建同名的topic就不報錯了。

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM