rackdevelop247
rackdevelop247

Reputation: 86

Kafka setup in windows 10

I am using windows 10 and I already have java installed in my machine The JAVA_HOME user variable is set to C:\Program Files\Java\jre1.8.0_121\bin path and same path for environment variable.
I want to use Kafka in my machine for a project. I download kafka from the link http://www-us.apache.org/dist/kafka/1.0.0/kafka_2.11-1.0.0.tgz

I extracted it to my C drive in a folder named as Kafka. I made the changes in zookeeper.properties file for dataDir as C:/Kafka/kafka_2.11-1.0.0/zookeeper-data and I also made changes in server.properties for log.dirs as C:/Kafka/kafka_2.11-1.0.0/kafka-logs.

I opened cmd in C:\Kafka\kafka_2.11-1.0.0\bin\windows path and gave the following command in order to run the zookeeper server zookeeper-server-start.bat ....\config\zookeeper.properties
The cmd is giving me error message as The system can not find the path specified. This is all I am getting. Kindly guide me to fix it and help me to run kafka. Thanks

Upvotes: 0

Views: 4246

Answers (2)

bhaskar raju
bhaskar raju

Reputation: 11

I have followed the following way to install Kafka in Windows.

Step 1: Download kafka from this link http://mirrors.sonic.net/apache/kafka/2.6.0/kafka_2.13-2.6.0.tgz

Step 2: Create a folder named kafka in C drive.

Step 3: Extract the downloaded tgz file in C:\kafka

Step 4: Create two folders zookeeper_data and kafka_logs in kafka directory

Step 5: Goto server.properties present in C:\kafka\config.

Change log.dirs=/tmp/kafka-logs to log.dirs=C:\kafka\kafka_logs

Step 6: Goto zookeeper.properties present in C:\kafka\config.

Change dataDir=/tmp/zookeeper to dataDir=C:\kafka\zookeeper_data

Step 7: Set C:\kafka\bin in environment variable.

Step 8:

Kafka needs zookeeper.

Starting zookeeper.

Open cmd and type C:\kafka\bin\zookeeper-server-start.bat C:\kafka\config\zookeeper.properties

Step 9:

Start Kafka.

Open another cmd and type C:\kafka\bin\kafka-server-start.bat C:\kafka\config\server.properties

P.S. Though the above steps help us in installing Kafka in Windows, there is an inherent defect in using Kafka with Windows. There is an error in the current Kafka for windows, which stops the Kafka server every time the log files are purged of the data.

Upvotes: 0

rackdevelop247
rackdevelop247

Reputation: 86

I solved the problem and now it is working fine. I mentioned JAVA_HOME path as C:\Program Files\Java\jre1.8.0_121\bin. It should be C:\Program Files\Java\jre1.8.0_121. Then there is no error. zookeeper started. kafka started. Thanks to those who tried.

Upvotes: 2

Related Questions