[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就不报错了。

 

 

 

转载于:https://www.cnblogs.com/mkl34367803/p/11182365.html

Logo

Kafka开源项目指南提供详尽教程,助开发者掌握其架构、配置和使用,实现高效数据流管理和实时处理。它高性能、可扩展,适合日志收集和实时数据处理,通过持久化保障数据安全,是企业大数据生态系统的核心。

更多推荐