You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
888 B

2 months ago
version: '3'
services:
kafka-zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
restart: always
ports:
- "2188:2181"
kafka:
image: wurstmeister/kafka
container_name: kafka
restart: always
hostname: kafka-hostname
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 0
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://172.26.45.217:9092 # 物理机地址
KAFKA_CREATE_TOPICS: "go-chat-message:2:0" # kafka启动后初始化一个有2个partition(分区)0个副本名叫go-chat-message的topic
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ADVERTISED_PORT: 9092
kafka-manage:
image: sheepkiller/kafka-manager
container_name: kafka-manage
restart: always
ports:
- "9000:9000"
environment:
ZK_HOSTS: zookeeper:2181