2012-12-19 21:47:11 +00:00
|
|
|
==========================
|
|
|
|
Block Device Quick Start
|
|
|
|
==========================
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2020-09-02 19:14:36 +00:00
|
|
|
Ensure your :term:`Ceph Storage Cluster` is in an ``active + clean`` state
|
2020-08-30 10:10:28 +00:00
|
|
|
before working with the :term:`Ceph Block Device`.
|
2013-05-23 18:45:14 +00:00
|
|
|
|
|
|
|
.. note:: The Ceph Block Device is also known as :term:`RBD` or :term:`RADOS`
|
|
|
|
Block Device.
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2013-06-11 19:11:51 +00:00
|
|
|
|
2020-04-09 13:25:39 +00:00
|
|
|
.. ditaa::
|
|
|
|
|
2013-09-30 22:01:39 +00:00
|
|
|
/------------------\ /----------------\
|
2016-05-06 09:20:40 +00:00
|
|
|
| Admin Node | | ceph-client |
|
2013-09-30 22:01:39 +00:00
|
|
|
| +-------->+ cCCC |
|
2016-05-06 09:20:40 +00:00
|
|
|
| ceph-deploy | | ceph |
|
2013-09-30 22:01:39 +00:00
|
|
|
\------------------/ \----------------/
|
2013-06-11 19:11:51 +00:00
|
|
|
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2013-09-30 22:01:39 +00:00
|
|
|
You may use a virtual machine for your ``ceph-client`` node, but do not
|
|
|
|
execute the following procedures on the same physical node as your Ceph
|
|
|
|
Storage Cluster nodes (unless you use a VM). See `FAQ`_ for details.
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2017-06-26 13:48:00 +00:00
|
|
|
Create a Block Device Pool
|
|
|
|
==========================
|
|
|
|
|
|
|
|
#. On the admin node, use the ``ceph`` tool to `create a pool`_
|
2017-06-05 19:27:46 +00:00
|
|
|
(we recommend the name 'rbd').
|
2013-09-30 22:01:39 +00:00
|
|
|
|
2017-06-26 13:48:00 +00:00
|
|
|
#. On the admin node, use the ``rbd`` tool to initialize the pool for use by RBD::
|
|
|
|
|
|
|
|
rbd pool init <pool-name>
|
|
|
|
|
2013-09-30 22:01:39 +00:00
|
|
|
Configure a Block Device
|
|
|
|
========================
|
|
|
|
|
|
|
|
#. On the ``ceph-client`` node, create a block device image. ::
|
|
|
|
|
2018-10-25 03:48:17 +00:00
|
|
|
rbd create foo --size 4096 --image-feature layering [-m {mon-IP}] [-k /path/to/ceph.client.admin.keyring] [-p {pool-name}]
|
2013-09-30 22:01:39 +00:00
|
|
|
|
|
|
|
#. On the ``ceph-client`` node, map the image to a block device. ::
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2018-10-25 03:48:17 +00:00
|
|
|
sudo rbd map foo --name client.admin [-m {mon-IP}] [-k /path/to/ceph.client.admin.keyring] [-p {pool-name}]
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2013-09-30 22:01:39 +00:00
|
|
|
#. Use the block device by creating a file system on the ``ceph-client``
|
|
|
|
node. ::
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2018-10-25 03:48:17 +00:00
|
|
|
sudo mkfs.ext4 -m0 /dev/rbd/{pool-name}/foo
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2013-05-23 18:45:14 +00:00
|
|
|
This may take a few moments.
|
|
|
|
|
2013-09-30 22:01:39 +00:00
|
|
|
#. Mount the file system on the ``ceph-client`` node. ::
|
2012-07-03 18:21:43 +00:00
|
|
|
|
2013-05-23 18:45:14 +00:00
|
|
|
sudo mkdir /mnt/ceph-block-device
|
2018-10-25 03:48:17 +00:00
|
|
|
sudo mount /dev/rbd/{pool-name}/foo /mnt/ceph-block-device
|
2013-05-23 18:45:14 +00:00
|
|
|
cd /mnt/ceph-block-device
|
2012-12-19 21:47:11 +00:00
|
|
|
|
2016-12-15 21:35:10 +00:00
|
|
|
#. Optionally configure the block device to be automatically mapped and mounted
|
|
|
|
at boot (and unmounted/unmapped at shutdown) - see the `rbdmap manpage`_.
|
|
|
|
|
2013-02-25 16:21:11 +00:00
|
|
|
|
2012-12-19 21:47:11 +00:00
|
|
|
See `block devices`_ for additional details.
|
|
|
|
|
2017-06-26 13:48:00 +00:00
|
|
|
.. _create a pool: ../../rados/operations/pools/#create-a-pool
|
2017-08-08 15:53:42 +00:00
|
|
|
.. _block devices: ../../rbd
|
2016-07-01 07:29:13 +00:00
|
|
|
.. _FAQ: http://wiki.ceph.com/How_Can_I_Give_Ceph_a_Try
|
2013-10-22 20:24:11 +00:00
|
|
|
.. _OS Recommendations: ../os-recommendations
|
2016-12-15 21:35:10 +00:00
|
|
|
.. _rbdmap manpage: ../../man/8/rbdmap
|