使用docker 模式 用ceph/daemon部署 ceph
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用docker 模式 用ceph/daemon部署 ceph相关的知识,希望对你有一定的参考价值。
获取ceph image
docker pull ceph/daemon
准备硬盘
mkfs.xfs /dev/vdb1 mkdir -p /opt/ceph/osd/vdb mount -o defaults,noatime,nodiratime,noexec,nodev,nobarrier /dev/vdb1 /opt/ceph/osd/vdb
部署mon
docker run -d --name mon0 -e MON_NAME=mon0 -e MON_IP=10.111.252.165 -e CEPH_PUBLIC_NETWORK=10.111.252.128/25 -e CEPH_CLUSTER_NETWORK=192.168.10.128/25 --net=host -v /etc/ceph:/etc/ceph -v /var/lib/ceph/:/var/lib/ceph/ -v /etc/localtime:/etc/localtime:ro ceph/daemon mon
编辑ceph.conf
[global] fsid = 41cbd215-1c41-4a30-abd6-c597375f8930 mon initial members = mon0 mon host = 10.111.252.165 auth cluster required = cephx auth service required = cephx auth client required = cephx public network = 10.111.252.128/25 cluster network = 192.168.10.128/25 osd journal size = 100 osd pool default size = 3 osd pool default min size = 2 osd crush update on start = false [mon] mon initial members = mon0 mon host = 10.111.252.165 [mon.mon0] host = mon0 mon addr = 10.111.252.165:6789 [client] rbd default format = 2 docker restart mon0
部署osd
docker run -d --name=osdvdb --net=host -v /etc/ceph:/etc/ceph -v /var/lib/ceph/:/var/lib/ceph/ -v /opt/ceph/osd/vdb:/var/lib/ceph/osd -e OSD_TYPE=directory -v /etc/localtime:/etc/localtime:ro ceph/daemon osd
复制/etc/ceph到其余节点,在其余节点上部署osd
scp -r /etc/ceph [email protected]:/etc/ scp -r /var/lib/ceph [email protected]:/var/lib/ ssh 10.111.252.222 rm -rf /var/lib/ceph/mon/ ssh 10.111.252.222 rm -rf /var/lib/ceph/osd/ scp -r /etc/ceph [email protected]:/etc/ scp -r /var/lib/ceph [email protected]:/var/lib/ ssh 10.111.252.231 rm -rf /var/lib/ceph/mon/ ssh 10.111.252.231 rm -rf /var/lib/ceph/osd/ mkfs.xfs /dev/vdb1 mkdir -p /opt/ceph/osd/vdb mount -o defaults,noatime,nodiratime,noexec,nodev,nobarrier /dev/vdb1 /opt/ceph/osd/vdb docker run -d --name=osdvdb --net=host -v /etc/ceph:/etc/ceph -v /var/lib/ceph/:/var/lib/ceph/ -v /opt/ceph/osd/vdb:/var/lib/ceph/osd -e OSD_TYPE=directory -v /etc/localtime:/etc/localtime:ro ceph/daemon osd
查看ceph状态
ceph -s cluster b448ce73-47eb-4a77-9a62-48ac7abc3218 health HEALTH_OK monmap e1: 1 mons at {mon0=10.111.252.165:6789/0} election epoch 4, quorum 0 mon0 osdmap e18: 3 osds: 3 up, 3 in flags sortbitwise pgmap v49: 64 pgs, 1 pools, 0 bytes data, 0 objects 401 MB used, 149 GB / 149 GB avail 64 active+clean
本文出自 “武陵荒草” 博客,请务必保留此出处http://penguintux.blog.51cto.com/3021117/1872939
以上是关于使用docker 模式 用ceph/daemon部署 ceph的主要内容,如果未能解决你的问题,请参考以下文章