Windows 下 Kafka 安装

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/wangming520liwei/article/details/101017169

                              Windows 下 Kafka 安装

Apache所有的开源软件的地址

https://mirrors.tuna.tsinghua.edu.cn/apache/

https://www.apache.org/dyn/closer.cgi

下载 Kafka 

https://www.apache.org/dyn/closer.cgi?path=/kafka/2.1.0/kafka_2.11-2.1.0.tgz

解压后

目录说明

bin目录:启动,停止等命令。 
config目录: 配置文件 
libs目录: 类库

启动和停止kafka

zookeeper.properties 配置修改

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=D:/zookeeper/dataTmp
dataLogDir=D:/zookeeper/log
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

启动 Zookeeper

启动 zookeeper 端口 2181
zookeeper-server-start.bat ../../config/zookeeper.properties

启动Kafka 

启动kafka,端口9092
kafka-server-start.bat ../../config/server.properties

如果想连接数据库

 
Kafka Connect 启动:(此处不需要,用于连接数据库)
connect-standalone.bat ../../config/connect-standalone.properties ../../config/mysql.properties

停止kafka

进入bin\windows目录下,按先后顺序启动

kafka-server-stop.bat
zookeeper-server-stop.bat

参考资料:

猜你喜欢

转载自blog.csdn.net/wangming520liwei/article/details/101017169