Reputation: 31
I am facing issue when starting Kafka server in my local machine (Windows 10) using command bin\windows\kafka-server-start \config\server.properties. I am getting error below. I already have zookeeper server running.
[2018-12-26 12:03:14,124] INFO Registered kafka:type=kafka.Log4jController
MBean (kafka.utils.Log4jControllerRegistration$)
[2018-12-26 12:03:14,155] ERROR Exiting Kafka due to fatal exception
(kafka.Kafka$)
java.nio.file.NoSuchFileException: \config\server.properties
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
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)
Upvotes: 2
Views: 5703
Reputation: 51
I'm currently using kafka 2.12-2.1.1 version. For me it worked when I initialize the kafka server with the following input:
kafka-server-start.bat \Tools\kafka_2.12-2.1.1\config\server.properties
Obs: Command source from the kafka_2.12-2.1.1\bin\windows Obs2: I created the Tools folder inside C: to put the kafka and zookeeper files inside.
Upvotes: 4
Reputation: 12683
Running kafka-server-start.bat from within:
C:\Apache\kafka_2.12–2.3.1\bin\windows>
and using a relative path like this:
kafka-server-start.bat ../../config/server.properties
worked for me, for both kafka_2.12–2.3.1
and kafka-2.4.0
.
Upvotes: 3
Reputation: 11
It is not able to find the server.properties file in the same folder. Provide the absolute path as below and it runs successfully.
kafka-server-start.bat C:\DEVTools\kafka_2.12-2.3.1\config\server.properties
Upvotes: 1
Reputation: 741
For those who have added kafka binary's path to window's environment PATH variable and still stuck : Passing relative path of server.properties (like ..\..\config\server.properties) with respect to binary location (as added in PATH) will not work. You will have to pass absolute path for server.properties file.
Upvotes: 1
Reputation: 1164
If you are running kafka-server-start from kafka home directory, remove "\" before config. It should do the magic.
bin\windows\kafka-server-start config\server.properties
Thanks, Naveen
Upvotes: 2