- 【4.8.1】服务器安装 Docker Swarm中搭建 Zoo
- 【docker】docker、docker swarm及port
- 【5.2】portainer的使用 仓库配置
- Ansible Role 容器 之【docker-swarm】
- 使用 Portainer 管理 Docker Swarm 集群
- Docker Swarm 使用NFS 搭建 S3 (minio)
- docker registry搭建及配置用户认证
- 【6.1】服务器安装 Docker Swarm中搭建 Porta
- 【4.11】服务器安装 Docker Swarm中搭建 Spri
- 【4.9.1】服务器安装 Docker Swarm中搭建 Had
https://hub.docker.com/_/zookeeper
mkdir -p /home/zk/zookeeper1/data
mkdir -p /home/zk/zookeeper1/conf
mkdir -p /home/zk/zookeeper1/logs
#docker-compose.yaml
version: '3'
services:
zoo1:
image: zookeeper:3.6.1
restart: always
hostname: zoo1
ports:
- 2181:2181
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/zk/zookeeper1/data:/data
- /home/zk/zookeeper1/datalog:/datalog
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
networks:
zookeeper_default:
deploy:
placement:
constraints:
- node.hostname == worker1
zoo2:
image: zookeeper:3.6.1
restart: always
hostname: zoo2
ports:
- 2182:2181
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/zk/zookeeper2/data:/data
- /home/zk/zookeeper2/datalog:/datalog
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
networks:
zookeeper_default:
deploy:
placement:
constraints:
- node.hostname == worker1
zoo3:
image: zookeeper:3.6.1
restart: always
hostname: zoo3
ports:
- 2183:2181
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/zk/zookeeper3/data:/data
- /home/zk/zookeeper3/datalog:/datalog
environment:
ZOO_MY_ID: 3
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
networks:
zookeeper_default:
deploy:
placement:
constraints:
- node.hostname == worker1
zkui:
image: registry.cn-hangzhou.aliyuncs.com/wkaca7114/zkui
container_name: zkui
ports:
- 9010:9090
depends_on:
- zoo1
links:
- zoo1
environment:
ZK_SERVER: zoo1:2181
访问http://192.168.0.103:9010/login
这里用你自己的ip
zkui 默认账户密码 admin/manager
点波关注 系统搭建(docker)
网友评论