How to install Kafka on Windows?

Yves M. picture Yves M. · Apr 16, 2014 · Viewed 84.9k times · Source

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 0.8 on Windows: http://janschulte.wordpress.com/2013/10/13/apache-kafka-0-8-on-windows/

It's a good article, but it's outdated, unfortunately.

Does someone know a way to achieve that?

Answer

Yves M. picture Yves M. · Apr 17, 2014

Ok, it's finally not complicated :)

The only steps are:

  1. Download Kafka and uncompress it somewhere nice (let's say C:/Kafka)
  2. Install Cygwin
  3. 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 "$@"

  4. In Environment Variables, Add java to your Path System Variable:

    enter image description here

That's it.. you can now run ZooKeeper and Kafka servers and start playing with topics and stuff..