First, install the Java JDK
1. Download the installation package
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Note: Download the corresponding installation package according to the 32/64-bit operating system
2. Add System Variables: Java_home=c:\program Files (x86) \java\jdk1.8.0_144
Second, installation zookeeper
1. Download the installation package
Http://zookeeper.apache.org/releases.html#download
2, unzip and enter zookeeper directory, author: D:\Kafka\zookeeper-3.4.9\conf
3. Rename "Zoo_sample.cfg" to "zoo.cfg"
4. Open "Zoo.cfg" to find and edit datadir=d:\\kafka\zookeeper-3.4.9\\tmp
5. Add System variable: zookeeper_home=d:\kafka\zookeeper-3.4.9
6. Edit Path system variable, add route:%zookeeper_home%\bin
7. Modify the default zookeeper port in the Zoo.cfg file (default port 2181)
8. Open new cmd, enter "zkserver", Run zookeeper
9. The command line prompt is as follows: Description Local zookeeper startup success
Note: Do not close this window.
Third, installation Kafka
1. Download the installation package
Http://kafka.apache.org/downloads
Note To download the binary version
2, unzip and enter Kafka directory, author: D:\Kafka\kafka_2.12-0.11.0.0
3. Enter the config directory to find the file server.properties and open
4. Find and edit Log.dirs=d:\kafka\kafka_2.12-0.11.0.0\kafka-logs
5. Find and edit zookeeper.connect=localhost:2181
6. Kafka will run on port 9092 by default, and connect the default port of zookeeper: 2181
7, enter the Kafka installation directory D:\Kafka\kafka_2.12-0.11.0.0, press shift+ Right-click, select the "Open command Window" option, open the command line, enter:
. \bin\windows\kafka-server-start.bat. \config\server.properties
Note: do not close this window, make sure the zookeeper instance is ready and running before enabling Kafka
Iv. Testing
1, create the theme, enter the Kafka installation directory D:\Kafka\kafka_2.12-0.11.0.0, press shift+ Right-click, select the "Open command Window" option, open the command line, enter:
. \bin\windows\kafka-topics.bat--create--zookeeper localhost:2181--replication-factor 1--partitions 1--topic test
Note: Do not close this window.
View topic Input:
. \bin\windows\kafka-topics.bat--list--zookeeper localhost:2181
2, create the producer, enter the Kafka installation directory D:\Kafka\kafka_2.12-0.11.0.0, press shift+ Right-click, select the "Open command Window" option, open the command line, enter:
. \bin\windows\kafka-console-producer.bat--broker-list localhost:9092--topic test
Note: Do not close this window.
3, create the consumer, enter the Kafka installation directory D:\Kafka\kafka_2.12-0.11.0.0, press shift+ Right-click, select the "Open command Window" option, open the command line, enter:
. \bin\windows\kafka-console-consumer.bat--bootstrap-server localhost:9092--topic test--from-beginning
4. Accomplished
Reference URL:
http://kafka.apache.org/
Https://github.com/confluentinc/confluent-kafka-dotnet
Http://www.cnblogs.com/cyfonly/p/5954614.html
http://blog.csdn.net/evankaka/article/details/52421314
Running Kafka on Windows Setup