1、启动zookeeper
docker run -d --name zookeeper -p 2181:2181 -t wurstmeister/zookeeper
2、启动kafka
docker run -d --name kafka --publish 9092:9092 --link zookeeper:zookeeper -e KAFKA_BROKER_ID=1 -e HOST_IP=127.0.0.1 -e KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092 -e KAFKA_ADVERTISED_HOST_NAME=127.0.0.1 -e KAFKA_ADVERTISED_PORT=9082 --restart=always -t wurstmeister/kafka
3、启动kafdrop
docker run -d --name=kafdrop -p 9100:9000 --link kafka -e KAFKA_BROKERCONNECT=kafka:9092 obsidiandynamics/kafdrop:latest