MapReduce服务 MRS-执行Kafka Topic删除操作时发现无法删除:解决办法
解决办法
- ZooKeeper连接失败导致。
Kafka客户端连接ZooKeeper服务超时。检查客户端到ZooKeeper的网络连通性。
网络连接失败,通过Manager界面查看Zookeeper服务信息。
图1 Zookeeper服务信息配置错误,修改客户端命令中ZooKeeper地址。
- Kafka服务端配置禁止删除。
通过Manager界面修改delete.topic.enable为true。保存配置并重启服务。
图2 修改delete.topic.enable客户端查询命令,无Topic:test。
kafka-topics.sh --list --zookeeper 192.168.0.122:24002/kafka
进入RunningAsController节点日志目录,在controller.log发现Deletion of topic test successfully。
2016-03-10 10:39:40,665 | INFO | [delete-topics-thread-3] | [Partition state machine on Controller 3]: Invoking state change to OfflinePartition for partitions [test,2],[test,15],[test,6],[test,16],[test,12],[test,7],[test,10],[test,13],[test,9],[test,19],[test,3],[test,5],[test,1],[test,0],[test,17],[test,8],[test,4],[test,11],[test,14],[test,18] | kafka.controller.PartitionStateMachine (Logging.scala:68)2016-03-10 10:39:40,668 | INFO | [delete-topics-thread-3] | [Partition state machine on Controller 3]: Invoking state change to NonExistentPartition for partitions [test,2],[test,15],[test,6],[test,16],[test,12],[test,7],[test,10],[test,13],[test,9],[test,19],[test,3],[test,5],[test,1],[test,0],[test,17],[test,8],[test,4],[test,11],[test,14],[test,18] | kafka.controller.PartitionStateMachine (Logging.scala:68)2016-03-10 10:39:40,977 | INFO | [delete-topics-thread-3] | [delete-topics-thread-3], Deletion of topic test successfully completed | kafka.controller.TopicDeletionManager$DeleteTopicsThread (Logging.scala:68)
- Kafka部分节点处于停止或者故障状态。
启动停止的Broker实例。
客户端查询命令,无Topic:test。
kafka-topics.sh --list --zookeeper 192.168.0.122:24002/kafka
进入RunningAsController节点日志目录,在controller.log发现Deletion of topic test successfully。
2016-03-10 11:17:56,463 | INFO | [delete-topics-thread-3] | [Partition state machine on Controller 3]: Invoking state change to NonExistentPartition for partitions [test,4],[test,1],[test,8],[test,2],[test,5],[test,9],[test,7],[test,6],[test,0],[test,3] | kafka.controller.PartitionStateMachine (Logging.scala:68)2016-03-10 11:17:56,726 | INFO | [delete-topics-thread-3] | [delete-topics-thread-3], Deletion of topic test successfully completed | kafka.controller.TopicDeletionManager$DeleteTopicsThread (Logging.scala:68)
- Kafka配置自动创建,且Producer未停止。
停止相关应用,通过Manager界面修改“auto.create.topics.enable”为“false”,保存配置并重启服务。
图3 修改auto.create.topics.enable - 再次执行delete操作。
- MapReduce服务_如何使用MapReduce服务_MRS集群客户端安装与使用
- MapReduce服务_什么是Kafka_如何使用Kafka
- 大数据分析是什么_使用MapReduce_创建MRS服务
- kafka是什么_kafka介绍_分布式消息服务Kafka版
- MapReduce服务_什么是MapReduce服务_什么是HBase
- RocketMQ是什么_RocketMQ介绍_分布式消息服务RocketMQ版
- MRS备份恢复_MapReduce备份_数据备份
- 分布式消息中间件实战_分布式消息实战_分布式消息-华为云
- MapReduce服务_什么是ZooKeeper_如何使用ZooKeeper
- MapReduce服务_什么是Flume_如何使用Flume