操作系统: win7 64位
zookeeper版本:zookeeper-3.4.11
kafka版本:kafka_2.11-1.1.0
1 zookeeper 安装
下载zookeeper-3.4.11解压:D:\Soft\zookeeper-3.4.11
进入D:\Soft\zookeeper-3.4.11\conf 目录复制文件 zoo_sample.cfg重新命名为 zoo.cfg
zoo.cfg 内容如下:
tickTime=2000
initLimit=10
syncLimit=5
dataDir=D:/Soft/zookeeper-3.4.11/data
dataLogDir=D:/Soft/zookeeper-3.4.11/logs
clientPort=2181
启动zookeeper: 进入 D:\Soft\zookeeper-3.4.11\bin 运行 zkServer.cmd 即可。
2 kafka 安装
下载kafka_2.11-1.1.0解压:D:\Soft\kafka_2.11-1.1.0
修改D:\Soft\kafka_2.11-1.1.0\config\server.properties文件
broker.id=0
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
# 修改日志目录
log.dirs=D:\Soft\kafka_2.11-1.1.0\logs
num.partitions=1
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
# zookeeper连接配置
zookeeper.connect=localhost:2181
zookeeper.connection.timeout.ms=6000
group.initial.rebalance.delay.ms=0
启动kafka:进入D:\Soft\kafka_2.11-1.1.0 运行cmd执行 .\bin\windows\kafka-server-start.bat .\config\server.properties
如果启动报错参考: kafka运行错误:提示找不到或者无法加载主类错误解决方法