Reputation: 11985
I'm getting below error while starting the Kafka-Server on Windows machine. I've downloaded Scala 2.11 - kafka_2.11-2.1.0.tgz
from the link: https://kafka.apache.org/downloads and I did the following steps:
Go to config
folder in Apache Kafka
(C:\Apache-Kafka\kafka_2.11-2.1.0\config
) and edit “server.properties”
using any text editor.
Find log.dirs
and repelace after “=/tmp/kafka-logs”
to C:\Apache-Kafka\kafka_2.11-2.1.0\kafka-logs
.
Now simply start the server:
>kafka-server-start.bat C:\Apache-Kafka\kafka_2.11-2.1.0\config
Error:
C:\Apache-Kafka\kafka_2.11-2.1.0\bin\windows>kafka-server-start.bat C:\Apache-Kafka\kafka_2.11-2.1.0\config
[2018-12-14 21:09:34,566] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2018-12-14 21:09:34,583] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
java.nio.file.AccessDeniedException: C:\Apache-Kafka\kafka_2.11-2.1.0\config
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.newByteChannel(WindowsFileSystemProvider.java:230)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.apache.kafka.common.utils.Utils.loadProps(Utils.java:560)
at kafka.Kafka$.getPropsFromArgs(Kafka.scala:42)
at kafka.Kafka$.main(Kafka.scala:58)
at kafka.Kafka.main(Kafka.scala)
C:\Apache-Kafka\kafka_2.11-2.1.0\bin\windows>
Note: I've already setup Apache Zookeeper on my Windows machine and it's running on port 2181
.
I run the command using run as administrator.
Upvotes: 4
Views: 23295
Reputation: 986
You can try:
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
Upvotes: 0
Reputation: 1522
this cmd works for me
C:\kafka\bin\windows>kafka-server-start.bat ../../config/server.properties
or try this (I guess you set your environment variable)
C:\kafka>kafka-server-start.bat config/server.properties
Upvotes: 0
Reputation: 51
Try this after kafka-server-start.bat
use this: ....\config\server.properties with slash between 2 dots
Upvotes: 1
Reputation: 346
In general we must not use C: drive to store kafka-logs. You can try using the drive other than the C: for storing Kafka logs. It must work.
Change the property log.dirs={Drive other than C:}/tmp/kafka-logs present in KafkaHome/config/server.properties.
Upvotes: 0