Ceph Notes

From Wiki
Jump to: navigation, search

To use rbd images in ceph you will first need to install the ceph-common package which contains the rbd command.

apt-get install ceph-common

Once this is done copy over the ceph config from your cluster.

rsync -avHl -e ssh root@mon1:/etc/ceph/ /etc/ceph/

Next create a secret file for rbd.

ceph auth print-key client.foo > secret.txt

scp the secret file to your client.

List volumes (images) in a pool:

rbd ls -m 192.168.0.1:6789,192.168.0.2:6789,192.168.0.3:6789 --pool pool0 --id foo --secret /etc/ceph/secret

Map volume to a block device:

rbd map -m 192.168.0.1:6789,192.168.0.2:6789,192.168.0.3:6789 --pool pool0 --id foo --secret /etc/ceph/secret volume1