docker运行kafka manager

本文简单介绍下docker运行kafka以及kafka manager

镜像

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启动

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:2181

bug,明明docker是kafka0.9的,这个manager界面确只有0.8版本的可供选择

doc

  • DockerKafka/kafka-manager-docker

你可能感兴趣的:(docker运行kafka manager)