Zookeeper:Docker环境下搭建Zookeeper集群

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Zookeeper:Docker环境下搭建Zookeeper集群相关的知识,希望对你有一定的参考价值。

下载镜像

docker pull garland/zookeeper

搭建:

docker run -d  --name=zk1  --net=host  -e SERVER_ID=1  -e ADDITIONAL_ZOOKEEPER_1=server.1=localhost:2888:3888  -e ADDITIONAL_ZOOKEEPER_2=server.2=localhost:2889:3889  -e ADDITIONAL_ZOOKEEPER_3=server.3=localhost:2890:3890  -e ADDITIONAL_ZOOKEEPER_4=clientPort=2181  garland/zookeeper

docker run -d  --name=zk2  --net=host  -e SERVER_ID=2  -e ADDITIONAL_ZOOKEEPER_1=server.1=localhost:2888:3888  -e ADDITIONAL_ZOOKEEPER_2=server.2=localhost:2889:3889  -e ADDITIONAL_ZOOKEEPER_3=server.3=localhost:2890:3890  -e ADDITIONAL_ZOOKEEPER_4=clientPort=2182  garland/zookeeper

docker run -d  --name=zk3  --net=host  -e SERVER_ID=3  -e ADDITIONAL_ZOOKEEPER_1=server.1=localhost:2888:3888  -e ADDITIONAL_ZOOKEEPER_2=server.2=localhost:2889:3889  -e ADDITIONAL_ZOOKEEPER_3=server.3=localhost:2890:3890  -e ADDITIONAL_ZOOKEEPER_4=clientPort=2183  garland/zookeeper

 

 

文档:

https://github.com/denverdino/aliyungo/wiki/Zookeeper-cluster-with-Docker

以上是关于Zookeeper:Docker环境下搭建Zookeeper集群的主要内容,如果未能解决你的问题,请参考以下文章

zookeeper环境及dubbo-admin管理平台搭建

centos7.x搭建zookeeper集群

大数据Apache Druid:Druid集群搭建

DCOS=Mesos+ZooKeeper+Marathon+Docker

我的 kafka docker 容器无法连接到我的 zookeeper docker 容器

sh 创建kafka和zookeeper docker