0
votes

While trying to start zookeeper in the windows 10 OS, I am getting the error \Apache was unexpected at this time

I have used the command with backlash as well as forward slash no use

E:\kafka\kafka_2.12-2.2.0\kafka_2.12-2.2.0\bin\windows>zookeeper-server-start.bat config/zookeeper.properties

\Apache was unexpected at this

enter image description here time.

2
kafka-server-start wouldn't use zookeeper.properties anyway... Perhaps you meant to do zookeeper-server-start? - OneCricketeer
yes sorry zookeeper server start. path is correct I am not sure wat is that message "\apache was unexpected at this time" - Yogesh Kumar Gupta
bin/windows/zookeeper-server-start.bat is the script file that you should use for starting a local zookeeper process. kafka-server-start.bat is for starting kafka process. - yuyang
I have added the screen shot with the error also since this is one of its own kind of issue. - Yogesh Kumar Gupta
I haven't ran Kafka on windows recently, so I am unsure where your error would be coming from - OneCricketeer

2 Answers

0
votes

You are passing \config... as the properties path, interpreted as E:\config.. so zookeeper won't be finding its configuration properly.

I guess it defaults to looking elsewhere hence the "\Apache was unexpected at this time" error.

Just add the missing dot to the config path, i.e. .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties and it should work.

0
votes

I have figured out the issue. The error was coming while setting class path as the bat file did not have administrative privilege.