Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 804 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Could not start zookeeper for kafka on windows

#1
I have the following folder structure:

[![enter image description here][1]][1]


[1]:


from `C:\Program Files\kafka\kafka_2.11-0.11.0.0` frolder I try to execute following command:

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

and it reponds with following message:

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

I tried to use several another variants but I still see errors:

C:\Program Files\kafka\kafka_2.11-0.11.0.0>bin\windows\zookeeper-server-start.bat
USAGE: bin\windows\zookeeper-server-start.bat zookeeper.properties

----
C:\Program Files\kafka\kafka_2.11-0.11.0.0>bin\windows\zookeeper-server-start.bat C:\Program Files\kafka\kafka_2.11-0.11.0.0\config\zookeeper.properties
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

-----
C:\Program Files\kafka\kafka_2.11-0.11.0.0>bin\windows\zookeeper-server-start.bat 'C:\Program Files\kafka\kafka_2.11-0.11.0.0\config\zookeeper.properties'
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.


What do I wrong?
Reply

#2
Paths containing spaces need to be enquoted (i.e. `"C:\Program Files\kafka\"` instead of `C:\Program Files\kafka\`).

The simplest solution would be to move your `kafka` folder to a path which contains no spaces, such as `C:\kafka`, and adjust the configuration file accordingly.

Another option would be to edit your configuration files (and possibly the batch files as well) and to enquote the paths which contain spaces.

A third, unrecommended option would be to use the 8.3 path syntax, which means editing the config and batch files to use `C:\Progra~1\kafka` instead of `C:\Program Files\kafka`
Reply

#3
You can try this:

bin\windows\zookeeper-server-start.bat .. \ ..\config\zookeeper.properties
Reply

#4
I got the same issue when I want to run server. Actually this had happened due to the long path where you had saved your Kafka Folder. Previously I had saved my Kafka folder in User's Directory ("C:\Users\xxxx\xxxx\kafka_2.13-2.8.0"). So after changing path of my Kafka folder to ("C:\") it got solved.
Reply

#5
You can resolve this issue by declaring path in environment variable for your kafka folder like this C:\kafka_2.12-2.8.0\bin\windows and after that open a fresh terminal and try to run the same command and it will work hopefully.
Reply

#6
The path is too long, move the folder to "C:\kafka_2.11-0.11.0.0" and then run the command again, this should work.
Reply

#7
Commands to follow for kafka and zookeeper set up:
1. Download kafka from

[To see links please register here]

And store into D:\Learning\kafka then unzip it there only.

2. Set path in environment veriable as D:\Learning\kafka\kafka_2.13-3.5.0\bin\windows

3. Start the kafka –
Open cmd in D:\Learning\kafka\kafka_2.13-3.5.0\bin\windows> and run

zookeeper-server-start.bat ..\..\config\zookeeper.properties

Open another cmd in D:\Learning\kafka\kafka_2.13-3.5.0\bin\windows> and run

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

4. Create the topic to store your events -
Open another cmd in D:\Learning\kafka\kafka_2.13-3.5.0\bin\windows> and run

kafka-topics.bat --create --topic quickstart-events --bootstrap-server localhost:9092
kafka-topics.bat --describe --topic quickstart-events --bootstrap-server localhost:9092

5. Write some topics into the topic –
Open another cmd in D:\Learning\kafka\kafka_2.13-3.5.0\bin\windows> and run

kafka-console-producer.bat --topic quickstart-events --bootstrap-server localhost:9092
This is my first event
This is my second event

6. Read the events –
Open another cmd in D:\Learning\kafka\kafka_2.13-3.5.0\bin\windows> and run

kafka-console-consumer.bat --topic quickstart-events --from-beginning --bootstrap-server localhost:9092



Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through