CentOS 7
Sponsored Link

Ceph Jewel : Use as Block Device2015/12/10

 
Configure Clients to use Ceph Storage like follows.
                                         |
        +--------------------+           |           +-------------------+
        |   [dlp.srv.world]  |10.0.0.30  |   10.0.0.x|   [   Client  ]   |
        |    Ceph-Deploy     +-----------+-----------+                   |
        |                    |           |           |                   |
        +--------------------+           |           +-------------------+
            +----------------------------+----------------------------+
            |                            |                            |
            |10.0.0.51                   |10.0.0.52                   |10.0.0.53 
+-----------+-----------+    +-----------+-----------+    +-----------+-----------+
|   [node01.srv.world]  |    |   [node02.srv.world]  |    |   [node03.srv.world]  |
|     Object Storage    +----+     Object Storage    +----+     Object Storage    |
|     Monitor Daemon    |    |                       |    |                       |
|                       |    |                       |    |                       |
+-----------------------+    +-----------------------+    +-----------------------+

 
For example, Create a block device and mount it on a Client.
[1] First, Configure Sudo and SSH key-pair for a user on a Client and next, Install Ceph from Ceph admin Node like follows.
[cent@dlp ceph]$
ceph-deploy install client

[cent@dlp ceph]$
ceph-deploy admin client
[2] Create a Block device and mount it on a Client.
[cent@client ~]$
sudo chmod 644 /etc/ceph/ceph.client.admin.keyring

# create a disk with 10G

[cent@client ~]$
rbd create disk01 --size 10G --image-feature layering
# show list

[cent@client ~]$
rbd ls -l

NAME     SIZE PARENT FMT PROT LOCK
disk01 10240M          2

# map the image to device

[cent@client ~]$
sudo rbd map disk01

/dev/rbd0
# show mapping

[cent@client ~]$
rbd showmapped

id pool image  snap device
0  rbd  disk01 -    /dev/rbd0

# format with XFS

[cent@client ~]$
sudo mkfs.xfs /dev/rbd0
# mount device

[cent@client ~]$
sudo mount /dev/rbd0 /mnt
[cent@client ~]$
df -hT

Filesystem          Type      Size  Used Avail Use% Mounted on
/dev/mapper/cl-root xfs        26G  1.9G   25G   7% /
devtmpfs            devtmpfs  2.0G     0  2.0G   0% /dev
tmpfs               tmpfs     2.0G     0  2.0G   0% /dev/shm
tmpfs               tmpfs     2.0G  8.4M  2.0G   1% /run
tmpfs               tmpfs     2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/vda1           xfs      1014M  230M  785M  23% /boot
tmpfs               tmpfs     396M     0  396M   0% /run/user/0
/dev/rbd0           xfs        10G   33M   10G   1% /mnt
Matched Content