1 上传kafka到/opt/upload
2 解压kafka到/opt/software
tar -zxvf kafka_2.12-3.6.1.tgz -C /opt/software/
3 修改server.properties
cd /opt/software/kafka_2.12-3.6.1/config
vim server.properties
修改以下内容
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://0.0.0.0:9092
zookeeper.connect=192.168.154.131:2181
4 启动kafka
cd /opt/software/kafka_2.12-3.6.1/bin
./kafka-server-start.sh ../config/server.properties &
注意:这里需要保证zookeeper是启动状态,zookeeper启动步骤请查看目录2.5
5 查看kafka进程
jps
出现kafka进程
6 停止kafka
cd /opt/software/kafka_2.12-3.6.1/bin
./kafka-server-stop.sh