【问题标题】:KAFKA - ERROR Failed to write meta.properties due to (kafka.server.BrokerMetadataCheckpoint)KAFKA - 错误由于(kafka.server.BrokerMetadataCheckpoint)而无法写入 meta.properties
【发布时间】:2021-04-29 12:10:21
【问题描述】:

我在Windows10上搭建Kafka源码读取环境, 并在下面遇到错误,所以有什么问题,我是一个学习kafka的新手

[2021-04-29 19:57:42,957] ERROR Failed to write meta.properties due to (kafka.server.BrokerMetadataCheckpoint)
java.nio.file.AccessDeniedException: C:\Users\a\workspace\kafka\logs
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
    at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:115)
[2021-04-29 19:57:42,973] ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
java.nio.file.AccessDeniedException: C:\Users\a\workspace\kafka\logs
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
    at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:115)

下面还有一个错误

[2021-04-29 19:57:43,821] ERROR Error while writing to checkpoint file C:\Users\a\workspace\kafka\logs\recovery-point-offset-checkpoint (kafka.server.LogDirFailureChannel)
java.nio.file.AccessDeniedException: C:\Users\a\workspace\kafka\logs
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
    at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:115)
[2021-04-29 19:57:43,823] ERROR Disk error while writing recovery offsets checkpoint in directory C:\Users\a\workspace\kafka\logs: Error while writing to checkpoint file C:\Users\a\workspace\kafka\logs\recovery-point-offset-checkpoint (kafka.log.LogManager)
[2021-04-29 19:57:43,833] ERROR Error while writing to checkpoint file C:\Users\a\workspace\kafka\logs\log-start-offset-checkpoint (kafka.server.LogDirFailureChannel)
java.nio.file.AccessDeniedException: C:\Users\a\workspace\kafka\logs
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
    at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:115)
[2021-04-29 19:57:43,834] ERROR Disk error while writing log start offsets checkpoint in directory C:\Users\a\workspace\kafka\logs: Error while writing to checkpoint file C:\Users\a\workspace\kafka\logs\log-start-offset-checkpoint (kafka.log.LogManager)

【问题讨论】:

  • 这个错误似乎是合理的,你能检查一下你是否能够将文件写入C:\Users\a\workspace\kafka\logs吗?
  • 你好@ITman - 请使用帖子旁边的复选标记接受下面的答案

标签: apache-kafka


【解决方案1】:

我降级到 Kafka 2.8.1 版本 (https://dlcdn.apache.org/kafka/2.8.1),之后一切正常。

【讨论】:

    【解决方案2】:

    这是发生日志保留时的常见错误。 版本无关紧要

    Kafka 对 Windows 文件系统没有很好的支持。

    您可以使用 WSL2 或 Docker 来解决这些限制 - https://www.confluent.io/blog/set-up-and-run-kafka-on-windows-linux-wsl-2/

    【讨论】:

      【解决方案3】:

      嵌入式 kafka 与 Spring 初始化程序 (https://start.spring.io/) 2.5.9 一起使用 Apache Kafka 和 Spring Web 的依赖项 Spring

      【讨论】:

        猜你喜欢
        • 2019-06-19
        • 2021-01-18
        • 1970-01-01
        • 2016-12-25
        • 1970-01-01
        • 2017-10-12
        • 2023-03-31
        • 1970-01-01
        • 2020-12-07
        相关资源
        最近更新 更多