1.官网下载,下载地址
2.安装至/usr/local/kafka3.3.1
#解压
tar -zxff kafka_2.12-3.3.1.tgz
#更改名字
mv kafka_2.12-3.3.1 kafka3.3.1
3.kafka3版本之后自带zookeeper,zookeeper配置文件的位置为解压后/config/zookeeper.properties
#主要是配置快照存放地址路径
dataDir=/usr/local/kafka3.3.1/zookeeperdata
#端口号
clientPort=2181
maxClientCnxns=0
admin.enableServer=false
4.修改kafka的配置文件,位置/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=/usr/local/kafka3.3.1/kafka-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.retention.check.interval.ms=300000
#zookeeper的地址和端口号
zookeeper.cOnnect=localhost:2181
zookeeper.connection.timeout.ms=18000
group.initial.rebalance.delay.ms=0
5.启动
zookeeper启动
[root@kht118 bin]# ./zookeeper-server-start.sh -daemon ../config/zookeeper.properties
[root@kht118 bin]# jps -l
87750 org.apache.zookeeper.server.quorum.QuorumPeerMain
87802 sun.tools.jps.Jps
[root@kht118 bin]# ps aux|grep zookeeper
kafka启动
[root@kht118 bin]# ./kafka-server-start.sh -daemon ../config/server.properties
[root@kht118 bin]# jps -l
87750 org.apache.zookeeper.server.quorum.QuorumPeerMain
89080 sun.tools.jps.Jps
89020 kafka.Kafka
[root@kht118 bin]# ps aux|grep kafka