本文簡單介紹下docker運行kafka以及kafka managergit
docker pull dockerkafka/zookeeper docker pull dockerkafka/kafka docker pull dockerkafka/kafka-manager
docker run -it --rm --name kafkadocker_zookeeper_1 -p 2181:2181 dockerkafka/zookeeper docker run -it --rm --name kafkadocker_kafka_1 --link kafkadocker_zookeeper_1:zookeeper -p 9092:9092 dockerkafka/kafka docker run -it --rm --link kafkadocker_zookeeper_1:zookeeper --link kafkadocker_kafka_1:kafka -p 9000:9000 -e ZK_HOSTS=zookeeper:2181 dockerkafka/kafka-manager
也能夠compose啓動github
zookeeper: image: dockerkafka/zookeeper ports: - "2181:2181" - "2888:2888" - "3888:3888" - "5000:5000" kafka: image: dockerkafka/kafka ports: - "9092:9092" links: - zookeeper:zookeeper kafka-manager: image: dockerkafka/kafka-manager environment: - ZK_HOSTS=zookeeper:2181 ports: - "9000:9000" links: - zookeeper:zookeeper - kafka:kafka volumes: - ./image/conf:/opt/kafka-manager-1.2.7/conf
192.178.99.100:9000,而後添加cluster便可,其中zk地址填寫zookeeper:2181docker
bug,明明docker是kafka0.9的,這個manager界面確只有0.8版本的可供選擇code