获取zookeeper镜像
docker pull zookeeper
创建zookeeper容器
docker run --name="zookeeper" -p 2181:2181 -v /Users/zhangsan/docker/zookeeper/data:/data -v /Users/zhangsan/docker/zookeeper/datalog:/datalog -d 容器ID
拉取zkui镜像(zookeeper的web管理工具)
docker pull registry.cn-hangzhou.aliyuncs.com/wkaca7114/zkui

备注:
zkui开源项目地址 https://github.com/DeemOpen/zkui
 
4.创建zkui容器
docker run --name="zkui" -p 9090:9090 --link zookeeper:zookeeper -e ZK_SERVER="zookeeper:2181" -d 镜像ID
 
5.也可以通过docker-compose编排来做(docker-compose up -d)
version: '3.4'
services:
zoo1:
image: zookeeper
container_name: zookeeper
restart: always
ports:
- 2181:2181
volumes:
- ~/docker/zookeeper/data:/data
- ~/data/zookeeper/datalog:/datalog
zkui:
image: registry.cn-hangzhou.aliyuncs.com/wkaca7114/zkui
container_name: zkui
ports:
- 9090:9090
depends_on:
- zoo1
links:
- zoo1
environment:
ZK_SERVER: zoo1:2181
 
05-11 18:21