7

基于 docker 搭建 zookeeper(3.4.14) 集群 (5个节点)

 3 years ago
source link: https://www.jansora.com/notes/107492
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

基于 docker 搭建 zookeeper(3.4.14) 集群 (5个节点)

docker-zk

基于 docker 搭建 zookeeper(3.4.14) 集群 (5个节点)

  1. 创建网络. docker network create -d bridge --subnet=192.168.0.0/24 --gateway=192.168.0.100 --ip-range=192.168.0.0/24 bigdata
  2. 拉取所有节点镜像; docker pull -a jansora/zk
docker run -it -d --name=zk1 --hostname=zk1 --network=zk zk1
docker run -it -d --name=zk2 --hostname=zk2 --network=zk zk2
docker run -it -d --name=zk3 --hostname=zk3 --network=zk zk3
docker run -it -d --name=zk4 --hostname=zk4 --network=zk zk4
docker run -it -d --name=zk5 --hostname=zk5 --network=zk zk5
  1. 集群状态检测 docker exec -it zk1 ./bin/zkServer.sh status

出现以下类似消息即为成功

ZooKeeper JMX enabled by default
Using config: /zk/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost.
Mode: follower

自主搭建 zookeeper 集群

参考 https://www.jansora.com/post/2020-07-06-zookeeper


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK