Docker-compose安装Kafka
Docker-compose安装Kafka
·
Docker-compose安装Kafka
1.配置文件
docker-compose配置文件
version: '3.0'
services:
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
container_name: kafka
volumes:
- /etc/localtime:/etc/localtime
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_PORT: 9092
KAFKA_LOG_RETENTION_HOURS: 120
KAFKA_MESSAGE_MAX_BYTES: 10000000
KAFKA_REPLICA_FETCH_MAX_BYTES: 10000000
KAFKA_GROUP_MAX_SESSION_TIMEOUT_MS: 60000
KAFKA_NUM_PARTITIONS: 3
KAFKA_DELETE_RETENTION_MS: 1000
kafka-manager:
image: sheepkiller/kafka-manager
container_name: kafka-manager
environment:
ZK_HOSTS: 127.0.0.1
ports:
- "9009:9000"
安装后:
2.内网安装
# 保存镜像
docker save -o kafka.tar wurstmeister/kafka
docker save -o zookeeper.tar wurstmeister/zookeeper
docker save -o kafka-manager.tar sheepkiller/kafka-manager
# 加载镜像
docker load -i kafka.tar
docker load -i zookeeper.tar
docker load -i kafka-manager.tar
# 启动镜像
docker-compose up -d --build
更多推荐
已为社区贡献2条内容
所有评论(0)