docker-compose ceph分布式存储部署
时间: 2023-10-29 17:06:42 浏览: 171
要使用docker-compose部署Ceph分布式存储,需要先编写docker-compose.yml文件,示例如下:
```
version: '3'
services:
mon:
image: ceph/daemon:latest
container_name: ceph-mon
command: mon
environment:
- CEPH_PUBLIC_NETWORK=0.0.0.0/0
volumes:
- ./ceph:/etc/ceph
- ceph-mon-data:/var/lib/ceph/mon
ports:
- "6789:6789"
networks:
- ceph
mgr:
image: ceph/daemon:latest
container_name: ceph-mgr
command: mgr
volumes:
- ./ceph:/etc/ceph
ports:
- "7000:7000"
- "7001:7001"
- "7002:7002"
networks:
- ceph
osd:
image: ceph/daemon:latest
container_name: ceph-osd
command: osd_scenario
environment:
- OSD_DEVICE=/dev/sdb
- OSD_FORCE_ZAP=1
- OSD_TYPE=disk
- KV_TYPE=etcdv3
- KV_IP=etcd:2379
- CEPH_PUBLIC_NETWORK=0.0.0.0/0
volumes:
- ./ceph:/etc/ceph
- ceph-osd-data:/var/lib/ceph/osd
- /dev/sdb:/dev/sdb
networks:
- ceph
volumes:
ceph-mon-data:
ceph-osd-data:
networks:
ceph:
```
在该文件中,定义了三个服务:mon、mgr和osd。其中,mon是监视器服务,mgr是管理器服务,osd是对象存储设备服务。每个服务都有自己的镜像、容器名、命令、环境变量、卷和网络等配置。
阅读全文