2

According to this link:

http://docs.ceph.com/docs/master/start/quick-rbd/

I can mount an rbd, which works perfectly. The question I have is how do I do this from fstab?

The end goal being to mount it to /var/lib/mysql

I've only found examples for cephfs mounts but not rbd.

1 Answer 1

7

To answer my own question. Which I originally found the answer to here (just before Noah posted his link to the forums)

Basically the file rbdmap (which I'd seen but not realised it's significance before) is the key to getting it working.

Note: I'm using ceph-deploy. That may or may not be significant.

The init script /etc/init.d/rbdmap and /etc/ceph/rbdmap are the key's to it.

First you need to enable to the init script. Under Ubuntu/Debian this can be achieved with.

sudo update-rc.d rbdmap defaults

Then edit /etc/ceph/rbdmap and add rbd entries according to the format given. By default, the rbdmap file contains:

# RbdDevice     Parameters
#poolname/imagename id=client,keyring=/etc/ceph/ceph.client.keyring

Enter new entries in there.

For my mysql disk:

rbd/mysql   id=admin,keyring=/etc/ceph/ceph.client.admin.keyring

And my fstab file contains:

/dev/rbd/rbd/mysql /mnt/mysql-data  ext4    defaults,noatime,_netdev        0       0

This will be mounted at startup and unmounted at shutdown. The _netdev parameter specifies that the rbd device will not be mounted until the networking is started and initialized.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .