安装kafka集群
作者:互联网
安装jdk
# wget https://download.oracle.com/java/18/latest/jdk-18_linux-x64_bin.rpm
# rpm -ivh jdk-18_linux-x64_bin.rpm
# java -version
下载kafka
# wget https://dlcdn.apache.org/kafka/3.2.0/kafka_2.13-3.2.0.tgz
将kafka传输到另外两台机器
# scp kafka_2.13-3.2.0.tgz 10.0.0.2:/root/
# scp kafka_2.13-3.2.0.tgz 10.0.0.5:/root/
解压
# tar -zxvf kafka_2.13-3.2.0.tgz -C /usr/local/
创建日志和数据目录
# mkdir -p /home/kafka/data
# mkdir -p /home/kafka/logs
修改kafka配置文件,注意:配置文件需要填写zk地址需要提前装好zk
# vim server.properties
# cat /usr/local/kafka_2.13-3.2.0/config/server.properties | grep -v '#' | grep -v '^$'
broker.id=0
listeners=PLAINTEXT://10.0.0.12:9092
advertised.listeners=PLAINTEXT://10.0.0.12:9092
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=/home/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.segment.bytes=1073741824
log.retention.check.interval.ms=300000
zookeeper.connect=10.0.0.14:2181,10.0.0.7:2181,10.0.0.3:2181
zookeeper.connection.timeout.ms=18000
group.initial.rebalance.delay.ms=0
启动kafka
/usr/local/kafka_2.13-3.2.0/bin/kafka-server-start.sh -daemon /usr/local/kafka_2.13-3.2.0/config/server.properties
标签:10.0,log,2.13,bytes,kafka,3.2,集群,安装 来源: https://www.cnblogs.com/zyyang1993/p/16528394.html