Docker搭建Kafka(单点,含:zookeeper、kafka-manager)
$ docker pull wurstmeister/zookeeper
$ docker pull wurstmeister/kafka
$ docker pull sheepkiller/kafka-manager
启动zookeeper
$ docker run -d --name zookeeper --publish 2181:2181 \
-v /etc/localtime:/etc/localtime --restart=always wurstmeister/zookeeper
启动kafka
$ docker run -d --name kafka --publish 9082:9092 \
--link zookeeper:zookeeper \
--env KAFKA_BROKER_ID=100 \
--env HOST_IP=192.168.1.108 \
--env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 \
--env KAFKA_ADVERTISED_HOST_NAME=192.168.1.108 \
--env KAFKA_ADVERTISED_PORT=9082 \
-v /etc/localtime:/etc/localtime --restart=always wurstmeister/kafka
启动kafka-manager
$ docker run -d --name kafka-manager -p 9000:9000 \
--link zookeeper:zookeeper --link kafka:kafka --env ZK_HOSTS=zookeeper:2181 \
--restart=always sheepkiller/kafka-manager
http://ip:9000/
点击下面保存按钮后,返回主页面