一、创建Kafka内部使用的bridge网络
docker network create kafka-net --driver bridge
二、创建zookeeper
docker run -d --name zookeeper-server \ --network kafka-net \ -e ALLOW_ANONYMOUS_LOGIN=yes \ bitnami/zookeeper:latest
三、创建Kafka服务
docker run -d --name kafka-server \ --network kafka-net \ -e ALLOW_PLAINTEXT_LISTENER=yes \ -e KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper-server:2181 \ bitnami/kafka:latest
四、启动Kafka
docker run -it --rm \ --network kafka-net \ -e KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper-server:2181 \ bitnami/kafka:latest kafka-topics.sh --list --zookeeper zookeeper-server:2181
五、启动Kafka后台管理
docker run -d --name kafka-manager -p 9000:9000 --network kafka-net -e ZK_HOSTS="zookeeper-server:2181" -e APPLICATION_SECRET=letmein sheepkiller/kafka-manager