CentOS 6
Sponsored Link

Ceph : Configure Client2014/06/29

 
How to use Ceph Cluster Storage from Clients.
                                    |
     +------------------+           |           +-----------------+
     |  [ Admin Node ]  |10.0.0.30  |  10.0.0.31|  [ Client PC ]  |
     |   Ceph-Deploy    |-----------+-----------|                 |
     | Meta Data Server |           |           |                 |
     +------------------+           |           +-----------------+
                                    |
        +---------------------------+--------------------------+
        |                           |                          |
        |10.0.0.80                  |10.0.0.81                 |10.0.0.82 
+-------+----------+       +--------+---------+       +--------+---------+
| [ Ceph Node #1 ] |       | [ Ceph Node #2 ] |       | [ Ceph Node #3 ] |
|  Monitor Daemon  +-------+  Monitor Daemon  +-------+  Monitor Daemon  |
|  Object Storage  |       |  Object Storage  |       |  Object Storage  |
+------------------+       +------------------+       +------------------+

[1] For example, mount as a block device on Admin Node. ( update kernel to the 3.x first like follows )
[cent@ceph-mds ~]$
sudo yum -y install centos-release-xen

[cent@ceph-mds ~]$
sudo yum -y update kernel

[cent@ceph-mds ~]$
# create an image-file with 5G

[cent@ceph-mds ~]$
rbd create disk01 --size 5120
# confirm

[cent@ceph-mds ~]$
rbd ls -l

NAME    SIZE PARENT FMT PROT LOCK
disk01 5120M          1

# map the image-file with a device

[cent@ceph-mds ~]$
sudo rbd map disk01
# confirm

[cent@ceph-mds ~]$
rbd showmapped

id pool image  snap device
1  rbd  disk01 -    /dev/rbd1

# format with ext4

[cent@ceph-mds ~]$
sudo mkfs.ext4 /dev/rbd1
# mount it

[cent@ceph-mds ~]$
sudo mount /dev/rbd1 /mnt
[cent@ceph-mds ~]$
df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_dlp-lv_root
                      189G  1.5G  178G   1% /
tmpfs                 2.0G     0  2.0G   0% /dev/shm
/dev/sda1             477M  114M  334M  26% /boot
/dev/rbd1             4.8G   10M  4.6G   1% /mnt
# just mounted

[2] For example, mount as a filesystem by CephFS from a ClientPC. ( update kernel to the 3.x first like follows )
[cent@dlp ~]$
sudo yum -y install centos-release-xen

[cent@dlp ~]$
sudo yum -y update kernel

[cent@dlp ~]$
[cent@dlp ~]$
sudo yum -y install http://ceph.com/rpm-firefly/el6/noarch/ceph-release-1-0.el6.noarch.rpm \
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[cent@dlp ~]$
sudo yum -y install yum-plugin-priorities
[cent@dlp ~]$
sudo sed -i -e "s/enabled=1/enabled=1\npriority=1/g" /etc/yum.repos.d/ceph.repo

[cent@dlp ~]$
sudo yum -y install ceph-fuse
# get Admin key from Admin Node

[cent@dlp ~]$
ssh ceph-mds.srv.world "sudo ceph-authtool -p /etc/ceph/ceph.client.admin.keyring" > admin.key

cent@ceph-mds.srv.world's password:
[cent@dlp ~]$
chmod 600 admin.key
[cent@dlp ~]$
sudo mount -t ceph ceph01.srv.world:6789:/ /mnt -o name=admin,secretfile=/home/cent/admin.key

[cent@dlp ~]$
df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_dlp-lv_root
                      189G  1.3G  178G   1% /
tmpfs                 4.0G     0  4.0G   0% /dev/shm
/dev/sda1             477M   92M  357M  21% /boot
10.0.0.81:6789:/      566G   49G  518G   9% /mnt
# just mounted

Matched Content