docker-compose安装kafka
docker-compose.ymlversion: "3.0"services:zookeeper:image: wurstmeister/zookeepercontainer_name: zookeeperrestart: alwaysports:- 2181:2181kafka:image: wurstmeister/kafkacontainer_name: kafkaports:- 90
·
docker-compose.yml
version: "3.0"
services:
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
restart: always
ports:
- 2181:2181
kafka:
image: wurstmeister/kafka
container_name: kafka
ports:
- 9092:9092
environment:
# client要访问的broker地址
KAFKA_ADVERTISED_HOST_NAME: kafka
# 通过端口连接 zookeeper
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
restart: always
volumes:
- ./docker.sock:/var/run/docker.sock
可视化工具想要连接kafka的话,需要在本机的host文件中配置
kafka kafka所部署的服务器ip
更多推荐
已为社区贡献2条内容
所有评论(0)