apache-kafka

Apache Kafka 4 Windows 11 Error on starting Kafka cluster server without zookeeper using KRaft


In windows 10 0r 11, Kafka installation I am facing the below error. When I Run the below command.

.\bin\windows\kafka-server-start.bat .\config\server.properties     
  1. Getting this error

java.nio.file.AccessDeniedException on kafka on Windows on the folder/ file : D:\tmp\kraft-combined-logs__cluster_metadata-0\

or

  1. this Error below

ERROR Exiting Kafka due to fatal exception (kafka.Kafka$) java.lang.RuntimeException: No readable meta.properties files found. at org.apache.kafka.metadata.properties.MetaPropertiesEnsemble.verify(MetaPropertiesEnsemble.java:480) ~[kafka-metadata-4.0.0.jar:?]


Solution

  • In windows 10 0r 11, if you are facing the above error.

    Follow the below steps.

    I was trying to start the kafka server, and got an error message as below

    Image showing the error

    It happened for me when I put the laptop to sleep for a few days and Kafka Producer crashed ( did not shutdown gracefully)

    Steps below :

    1. Delete the Log folder, In my case Kafka was run from d:drive, so my log folder was in D:\tmp\kraft-combined-logs, dont do this in production if your consumer hasnt read all messages.

    2. Run the below command to recreate the logs folder


    .\bin\windows\kafka-storage.bat format --standalone -t kafkastore -c .\config\server.properties

    3. You should see something like this :

    Image describing the result
    It does say complain about some error , but it creates the storage dir as needed.

    4. Run the below command to get the server up and running

    .\bin\windows\kafka-server-start.bat .\config\server.properties     
    

    5. You will see something like this below

    After Kafka started

    Kafka server cluster is up and running now