I\'m trying to install Kafka message queue on Windows for testing purposes (not for production).
I found this article on how to install Apache Kafka
You will probably find that Kafka comes with Windows .bat files under the bin folder to help you run Kafka under windows. However, those bat files are not updated since version 0.8.0 and some of Kafka's logic has changed (regarding topics, etc.).
I have tried two ways to solve this problem. One is to use Cygwin or MinGW to simulate Linux environment and run the Linux shell script, but there would be tons of other problems related to path names. The other solution, which is simpler and come with less trouble, is to use the corrected version of Windows bat files.
Please refer to this blog post.
Ok, it's finally not complicated :)
The only steps are:
C:/Kafka
)Edit \bin\kafka-run-class.sh
and at the end of the file, change
exec $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS "$@"
to
exec java $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp `cygpath -wp $CLASSPATH` $KAFKA_OPTS "$@"
In Environment Variables, Add java to your Path System Variable:
That's it.. you can now run ZooKeeper and Kafka servers and start playing with topics and stuff..
Refer the official documentation,
https://kafka.apache.org/quickstart
On Windows platforms use bin\windows\
instead of bin/
, and change the script extension to .bat
.
These are the steps I followed to run kafka on Windows
zookeeper-3.3.6.tar.gz
\zookeeper-3.3.6\bin> .\zkServer.cmd
Now this should up a Zookeeper instance on localhost:2181
kafka_2.10-0.10.0.1.tgz
.\config\server.properties
.\config\server.properties
replace log.dirs=c:/kafka/kafka-logs
./bin/windows
folder.\bin\windows\kafka-server-start.bat .\config\server.properties
A more current answer for the benefit of anyone else still wondering about this, I downloaded the binary and everything worked right out of the box. The source version, however, didn't work.