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

2021/5/1 7:28:20

本文主要是介绍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/

watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=

点击下面保存按钮后,返回主页面

 

watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=



这篇关于CentOS-Docker搭建Kafka(单点,含:zookeeper、kafka-manager)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程