Ceph practice summary: configuration of the RBD block device client in Centos
Before proceeding to this chapter, you need to complete the basic cluster building, please refer to the http://blog.csdn.net/eric_sunah/article/details/40862215
Ceph Block devices are also calledRBDOrRADOS. Block Device
During the experiment, a virtual machine can be used as the ceph-client node. To ensure cluster stability, do not perform the following operations on the cluster node.
Install Ceph
Use OS Recommendations to determine whether your client OS meets the basic requirements.
Use on Management NodesCeph-deployInCeph-clientIf ceph is installed on the node, it is called cephclient.
ceph-deploy install cephclient
Use ceph-deploy on the Management node to copy the ceph configuration file andCeph. client. admin. keyringToOn cephclient
ceph-deploy admin cephclient
Ceph-deployWill copy the keyring file/Etc/ceph directory. To ensure security, you can set the appropriate permissions for the file (e.g .,Sudo chmod + r/etc/ceph. client. admin. keyring).
Configure Block devices
Create a block device image on the cephclient Node
rbd create testdevice --size 40960 [-m {mon-IP}] [-k /path/to/ceph.client.admin.keyring]
Map the image to a block device on the cephclient Node
sudo rbd map foo --pool rbd --name client.admin [-m {mon-IP}] [-k /path/to/ceph.client.admin.keyring]
Format Block devices on the cephclient Node
sudo mkfs.ext4 -m0 /dev/rbd/rbd/testdevice
Mount the device.
sudo mkdir /mnt/ceph-block-devicesudo
sudo mount -t ext4 /dev/rbd/rbd/testdevice /mnt/ceph-block-devicesudo
cd /mnt/ceph-block-devicesudo
Check Result
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink">
VcHJlPgoKCgo8aDE + zsrm420.vade + identifier = "http://www.2cto.com/uploadfile/Collfiles/20141121/20141121095058151.png" alt = "\">
Cause and solution: if the above prompt appears, it indicates that the kernel has not compiled the rbd module. The solution is to upgrade the kernel version. For specific steps to upgrade, see: http://blog.csdn.net/eric_sunah/article/details/41282379
In the steps of make menuconfig, you can find rbd in block drive and select it.