wget https://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.6.1/kafka_2.12-2.6.1.tgz
tar -zxvf kafka_2.12-2.6.1.tgz
cd /home/kafka_2.12-2.6.1
vi /home/kafka_2.12-2.6.1/config/server.properties
修改: broker.id=0
#允许外部端口连接
listeners=PLAINTEXT://0.0.0.0:9092
#外部代理地址
advertised.listeners=PLAINTEXT://192.168.36.20:9092
使用kafka-server-start.sh启动kafka服务:
sh /home/zookeeper/bin/zkServer.sh start
sh /home/kafka_2.12-2.6.1/bin/kafka-server-start.sh /home/kafka_2.12-2.6.1/config/server.properties
kafka停止:
bin/kafka-server-stop.sh
bin/zookeeper-server-stop.sh