I have downloaded kafka_2.12-2.1.0 and placed in folder path "C:\kafka_2.12-2.1.0". For starting kafka zookeeper, I executed the below command in command prompt,
C:\kafka_2.12-2.1.0>bin\windows\zookeeper-server-start.bat config\zookeeper.properties
I am getting error message as below,
The syntax of the command is incorrect.
The filename, directory name, or volume label syntax is incorrect.
I could not understand what I am doing wrong. Can someone please help. I am successfully able to start zookeeper and kafka server in Linux "bin/zookeeper-server-start.sh config/zookeeper.properties"
Best Answer
First of all, don't forget that you're in a windows operating system so don't forget the dot
.
before the path.\bin\...
Zookeeper Installation Locate your Zookeeper config directory. For example
C:\zookeeper-3.4.7\conf
.Locate
.cfg
file and Copy and Renamezoo_sample.cfg
tozoo.cfg
inC:\Tools\zookeeper-3.4.9\conf
Open it with any text editor like Notepad++
Find and edit
dataDir=/tmp/zookeeper to :\zookeeper-3.4.7\data
In addition, add an entry in the System Environment Variables as you did for Java. this means something like this
add
;%ZOOKEEPER_HOME%\bin;
Run Zookeeper by opening a new cmd and type :
zkserver
.KafkaServer
Running a Kafka Server type
Create Topic
in order to create topics now you should do this:
Now create a topic with the name “test” and a replication factor of 1, as we have only one Kafka server running. If you have a cluster with more than one Kafka server running, you can increase the replication-factor accordingly, which will increase the data availability and act like a fault-tolerant system.
Open a new command prompt in the location C:\kafka_2.12-2.1.0\bin\windows.
Type the following command and hit Enter:
Creating a simple Producer and Consumer to Test
Open a new command prompt in the location C:\kafka_2.12-2.1.0\bin\windows and type this for the producer:
Again open a new command prompt in the same location and type:
Take a look at this post you will find it useful