我就静静地看着你,不说话~

CentOS-Docker搭建Kafka(单点,含:zookeeper、kafka-manager)

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

 

访问KafkaManager

http://ip:9000/

点击下面保存按钮后,返回主页面
 
posted @ 2020-03-12 10:26  自由人生™  阅读(156)  评论(0编辑  收藏  举报