- centos-8.3-minimal设置网络,加载配置并重启,需要注意不是systemctl
nmcli c reload
nmcli c up enp0s3
- 关闭防火墙
systemctl stop firewalld && systemctl disable firewalld
- 下载的压缩包文件如下
cmak-3.0.0.6.zip
jdk-17_linux-x64_bin.tar.gz
kafka_2.13-3.4.0.tgz
- 解压运行kafka
tar -zxvf kafka_2.13-3.4.0.tgz
- 启动zookeeper
export JAVA_HOME=/software/jdk-17.0.2
export PATH=$JAVA_HOME/bin:$PATH
nohup ./zookeeper-server-start.sh ../config/zookeeper.properties > zookeeper.log &
停止zookeeper可使用`./zookeeper-server-stop.sh`
- 进入目录kafka_2.13-3.4.0/bin启动kafka
export JAVA_HOME=/software/jdk-17.0.2
export PATH=$JAVA_HOME/bin:$PATH
nohup ./kafka-server-start.sh ../config/server.properties > kafka.log &
- 创建topic并查看所有topic
./kafka-topics.sh --bootstrap-server localhost:9092 --create --topic test-topic-temp
./kafka-topics.sh --bootstrap-server localhost:9092 --list
-
解压运行kafka控制台cmak
其中需要修改/conf/application.conf配置文件中的zookeeper配置
unzip cmak-3.0.0.6.zip -d .
./cmak -J--add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED -J--add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED
- 关闭cmak
ps -ef|grep cmak|grep -v grep| awk '{print $2}'|xargs kill -s 9 && rm -rf /software/cmak-3.0.0.6/RUNNING_PID