I tried to setup kafka and zookeeper on windows. Initially I created topics, producers and consumers. It was working fine. Then I deleted one topic by using the below command:
kafka-run-class.bat kafka.admin.TopicCommand --delete --topic junk --zookeeper localhost:2181
Now every time I re-run the kafka, it gets terminated with the below error: java.nio.file.AccessDeniedException: C:\kafka_2.12-2.8.0\kafka_2.12-2.8.0kafka-logs\junk-0 -> C:\kafka_2.12-2.8.0\kafka_2.12-2.8.0kafka-logs\junk-0.305f67a1260f4cccb87d9367c6619fd2-delete
I tried to remove the zookeper and kafka directory and use a fresh directory for both. But somehow its retaining the previous saved topics and logs (I don't know what location they're stored at).
Could anyone tell me how to fix this?
3条答案
按热度按时间osh3o9ms1#
我在使用新版本kafka_2.12-3.0.0时也遇到了同样的问题。使用较低版本kafka_2.12-2.8.1解决了这个问题
ukqbszuj2#
Login as admin, and try the below topic path/location the logs and
delete it manually
or delete all your logs (both kafka & zookeeper logs) if you want to try fresh/tmp/kafka-logs/[yourTopics]
// Delete *** Kafka LogsNow go back and try again. If you are still running into the problem then disable the cleaner
log.cleaner.enable = false
%temp%
in windows command, and delete all the temp files as wellUpdate to comment below - yes you can run on windows, with the WSL 2 subsystem/Linux 2 link from official confluent site
dohp0rv53#
我假设您的Kafka服务器是绑定到Zookeeper。如果真的,那么我们得到这个错误时,任何主题被删除。
要解决此问题,我们需要删除
apache-zookeeper-home\conf\zoo.cfg
文件中配置的数据目录文件夹