一. 新建文件docker-compose.yml
version: "3.8"
services:
zookeeper:
restart: always
image: 'bitnami/zookeeper:3.8.3'
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
restart: always
image: 'bitnami/kafka:3.6.0'
ports:
- '9092:9092'
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092
depends_on:
- zookeeper
二. compose文件当前目录启动
docker compose up -d
标签:compose,PLAINTEXT,zookeeper,9092,kafka,docker
From: https://www.cnblogs.com/liyaocool/p/17879682.html