如何在 Windows 上安装 Kafka? [英] How to install Kafka on Windows?

查看:31
本文介绍了如何在 Windows 上安装 Kafka?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Windows 上安装 ...

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?

解决方案

Ok, it's finally not complicated :)

The only steps are:

Edit (2021/10) Latest versions of Kafka end up with an AccessDeniedException upon startup, and even when successfully started, throw the same error during log rotation. Kafka utilizes Java methods designed for Unix filesystem libraries, so installing Kafka in WSL2 is recommended.

Old answer

  1. Download Kafka and uncompress it somewhere nice (let's say C:/Kafka)
  2. Install Cygwin

If using Cygwin, 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 "$@"``

  1. 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..

这篇关于如何在 Windows 上安装 Kafka?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆