In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to install zookeeper and kafka under windows", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to install zookeeper and kafka under windows" this article.
Steps to install zk and kafka under windows.
one。 Install ZOOKEEPER
The operation of Kafka depends on Zookeeper, so we need to install and run Zookeeper before running Kafka
2.1 download the installation file: http://zookeeper.apache.org/releases.html
2.2 decompress the file
2.3 Open zookeeper-3.4.13\ conf and rename zoo_sample.cfg to zoo.cfg
2.4 Open zoo.cfg from a text editor
2.5 change the value of dataDir to ". / zookeeper-3.4.13/data"
2.6 add the following system variables:
ZOOKEEPER_HOME: C:\ Users\ localadmin\ CODE\ zookeeper-3.4.13 (zookeeper directory)
Path: add ";% ZOOKEEPER_HOME%\ bin;" after the existing value
Run Zookeeper: open cmd and execute zkserver
Remember to add audit.enable=true if failed to enable
Test: zkCli.sh-server ip:port
Create a node: create / test "hello"
Delete nodes: delete / test
Get node data: get / test
two。 Install kafka
3.2 decompress the file
3.3.Open kafka_2.13-2.7.0\ config
3.4 Open server.properties from a text editor
3.5 change the value of log.dirs to ". / logs"
3.6 Open cmd
3.7 enter the kafka file directory: cd D:\ kafka_2.13-2.7.0 (kafka directory)
3.8 enter and execute:.\ bin\ windows\ kafka-server-start.bat.\ config\ server.properties
Create a topic:
4.1 Open cmd and enter cd C:\ Users\ localadmin\ CODE\ kafka_2.11-2.0.0\ bin\ windows
Create a topic: kafka-topics.bat-- create-- zookeeper localhost:2181-- replication-factor 1-- partitions 1-- topic test
Open a PRODUCER:
Cd C:\ Users\ localadmin\ CODE\ kafka_2.11-2.0.0\ bin\ windows
Kafka-console-producer.bat-broker-list localhost:9092-topic test
Open a CONSUMER:
Cd C:\ Users\ localadmin\ CODE\ kafka_2.11-2.0.0\ bin\ windows
Kafka-console-consumer.bat-bootstrap-server localhost:9092-topic test-from-beginning
Seeing this effect, it's done!
Note: the kafka directory should not be installed too deep, otherwise the "input line is too long" error will be reported.
The above is all the contents of the article "how to install zookeeper and kafka under windows". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.