安裝(Centos7)

Deploys a Ceph monitor

mkdir -p /etc/ceph
mkdir -p /var/lib/ceph
If SELinux is enabled, run the following commands:
sudo chcon -Rt svirt_sandbox_file_t /etc/ceph
sudo chcon -Rt svirt_sandbox_file_t /var/lib/ceph
docker run -d --name mon --net=host -v /etc/ceph:/etc/ceph -v /var/lib/ceph/:/var/lib/ceph/ -e MON_IP=192.168.43.243 -e CEPH_PUBLIC_NETWORK=192.168.43.0/24 ceph/daemon mon

Deploy a Manager daemon

docker run -d --name mgr --net=host --log-driver json-file --log-opt max-size=10m --log-opt max-file=5 -v /etc/ceph:/etc/ceph -v /var/lib/ceph/:/var/lib/ceph/ ceph/daemon mgr

Deploy an OSD

docker run -d --name osd --net=host -e OSD_TYPE=directory -v /etc/ceph:/etc/ceph -v /var/lib/ceph/:/var/lib/ceph/ ceph/daemon  osd
chown -R 64045:64045 /var/lib/ceph/osd/    

Install Docker Plugin

docker plugin install --alias register:2048/rexray/rbd rexray/rbd
docker push register:2048/rexray/rbd
Every docker host : docker plugin install register:8080/rexray/rbd

ceph-common 安裝

rpm --import 'https://download.ceph.com/keys/release.asc'
vi /etc/yum.repos.d/ceph.repo

[ceph]
name=Ceph packages for $basearch
baseurl=https://download.ceph.com/rpm-luminous/el7/$basearch
enabled=1
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc

[ceph-noarch]
name=Ceph noarch packages
baseurl=https://download.ceph.com/rpm-luminous/el7/noarch
enabled=1
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc

[ceph-source]
name=Ceph source packages
baseurl=https://download.ceph.com/rpm-luminous/el7/SRPMS
enabled=0
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc
yum install --nogpgcheck -y epel-release
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
yum -y install ceph-common

Note

  • 如果有mon變更env記得要清mount的目錄,會有組態
  • 在不同server記得要拷貝組態,目前已知 /etc/ceph/* 和 /var/lib/ceph/bootstrap-/
  • rexray/rbd預設使用rbd pool,要先建立
    ceph osd pool create rbd 128
    如果只有兩個osd(ceph osd pool set rbd size 2)
  • host kernel 必須載入rbd module,kernel 有可能沒支援
    modifo rbd
    modprobe rbd

聯結

Install
rexray
Docker Hub