我使用kafka、zookeeper和kafka管理器来管理集群。
我有3个节点。在我从一开始就设置的所有集群中 delete.topic.enable=true
现在,当我想删除一个主题,它显示以下错误。 topicxyz - marked for deletion
但不会被删除。
我也试着从Kafka经理那里删除,上面写着 Yikes! KeeperErrorCode = NodeExists for /admin/delete_topics/topicxyz
错误日志:
Kafka经理:
[ESC[31merrorESC[0m] k.m.ApiError$ - error : KeeperErrorCode = NodeExists for /admin/delete_topics/topicxyz
org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /admin/delete_topics/topicxyz
at org.apache.zookeeper.KeeperException.create(KeeperException.java:119) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:721) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:704) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:108) ~[org.apache.curator.curator-client-2.10.0.jar:na]
at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:701) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:477) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:467) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:447) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
[ESC[37minfoESC[0m] k.m.a.KafkaManagerActor - Updating internal state...
Kafka没有错误日志。Zookeeper标准错误日志显示只有警告,标准日志显示 Invalid config, exiting abnormally
Kafka版本:Kafka2.12-0.10.2.0
主题描述:
$ bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic topicxyz
Topic:topicxyz PartitionCount:1 ReplicationFactor:1 Configs:
Topic: topicxyz Partition: 0 Leader: -1 Replicas: 3 Isr:
请帮忙。
2条答案
按热度按时间fae0ux8s1#
这有时是由中发现的损坏的zookeeper节点引起的
/admin/delete_topics
. 登录zk客户端,删除错误行为/admin/delete_topics/your_topic_name
进入。根据客户端版本的不同,它将如下所示:bin/zkCli.sh -server 127.0.0.1:2181 ls /admin/delete_topics ls /brokers/topics rmr /admin/delete_topics/your_topic_name
您现在应该可以使用Kafka管理器或Kafka主题删除您的主题。您也可以通过删除“/brokers/topics/your\u topic\u name”条目手动删除您的主题,但我发现在删除行为不端的“delete\u topics”条目后,这是不必要的。jutyujz02#
我不知道你用的是哪个Kafka版本。但是删除一个主题之前有一个bug。请参阅此处和此处。