Docker部署Zookeeper及Kafka
启动Zookeeper
docker run -d --name zookeeper -p 2181:2181 -v /etc/localtime:/etc/localtime wurstmeister/zookeeper
启动kafka
docker run -td \
--name kafka \
-p 9092:9092 \
-e KAFKA_BROKER_ID=0 \
-e KAFKA_ZOOKEEPER_CONNECT=10.17.0.19:2181 \
-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://10.17.0.19:9092 \
-e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 \
wurstmeister/kafka
# 注意修改Zookeeper服务的IP及端口
查看Zookeeper版本信息
docker exec -it zookeeper-server /bin/bash
zkCli.sh -server 127.0.0.1:2181
评论区