Skip to content

Commit cf96f21

Browse files
authored
Merge pull request ceph#60420 from nbalacha/wip-nbalacha-namespace-doc
doc/rbd: namespace mirroring updates Reviewed-by: Sunil Angadi <[email protected]> Reviewed-by: Ilya Dryomov <[email protected]>
2 parents 92edf6c + 69992c8 commit cf96f21

File tree

2 files changed

+64
-8
lines changed

2 files changed

+64
-8
lines changed

doc/man/8/rbd.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,14 +532,16 @@ Commands
532532
disabled on all images (within the pool or namespace) for which mirroring
533533
was enabled, whether by default or explicitly.
534534

535-
:command:`mirror pool enable` [*pool-name*] *mode*
535+
:command:`mirror pool enable` *pool-name* *mode* [--remote-namespace *remote-namespace-name*]
536536
Enable RBD mirroring within a pool or namespace.
537537
The mirroring mode can either be ``pool`` or ``image``.
538538
If configured in ``pool`` mode, all images in the pool or namespace
539539
with the journaling feature enabled are mirrored.
540540
If configured in ``image`` mode, mirroring needs to be
541541
explicitly enabled (by ``mirror image enable`` command)
542542
on each image.
543+
A namespace can be mirrored to a different namespace on the remote
544+
pool using the ``--remote-namespace`` option.
543545

544546
:command:`mirror pool info` [*pool-name*]
545547
Show information about the pool or namespace mirroring configuration.

doc/rbd/rbd-mirroring.rst

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,21 @@ capability is available in two modes:
2323
blocks can be quickly determined without the need to scan the full RBD image.
2424
Since this mode is not as fine-grained as journaling, the complete delta
2525
between two snapshots will need to be synced prior to use during a failover
26-
scenario. Any partially applied set of deltas will be rolled back at moment
27-
of failover.
26+
scenario. Any partially applied set of deltas will be rolled back at the
27+
moment of failover.
2828

2929
.. note:: journal-based mirroring requires the Ceph Jewel release or later;
3030
snapshot-based mirroring requires the Ceph Octopus release or later.
3131

32+
.. note:: All instances of the term "namespace" in this document refer to RBD
33+
namespaces.
34+
3235
Mirroring is configured on a per-pool basis within peer clusters and can be
33-
configured on a specific subset of images within the pool. You can also mirror
34-
all images within a given pool when using journal-based
35-
mirroring. Mirroring is configured using the ``rbd`` command. The
36-
``rbd-mirror`` daemon is responsible for pulling image updates from the remote
37-
peer cluster and applying them to the image within the local cluster.
36+
configured on a namespace or specific subset of images within the pool or
37+
namespace. You can also mirror all images within a given pool or namespace when
38+
using journal-based mirroring. Mirroring is configured using the ``rbd``
39+
command. The ``rbd-mirror`` daemon is responsible for pulling image updates from
40+
the remote peer cluster and applying them to the image within the local cluster.
3841

3942
Depending on the desired needs for replication, RBD mirroring can be configured
4043
for either one- or two-way replication:
@@ -231,6 +234,57 @@ pool as follows:
231234
same name exists on the destination cluster, that pool will be used.
232235
#. If neither of the above is true, no data pool will be set.
233236

237+
Namespace Configuration
238+
=======================
239+
240+
Mirroring can be configured on a namespace in a pool. The pool must already
241+
have been configured for mirroring. The namespace can be mirrored to a namespace
242+
with the same or a different name in the remote pool.
243+
244+
Enable Mirroring
245+
----------------
246+
247+
To enable mirroring on a namespace with ``rbd``, issue the ``mirror pool enable``
248+
subcommand with the namespace spec and the mirroring mode, and an optional
249+
remote namespace name::
250+
251+
rbd mirror pool enable {pool-name}/{local-namespace-name} {mode} [--remote-namespace {remote-namespace-name}]
252+
253+
The mirroring mode can either be ``image`` or ``pool``:
254+
255+
* **image**: When configured in ``image`` mode, mirroring must
256+
`explicitly enabled`_ on each image.
257+
* **pool** (default): When configured in ``pool`` mode, all images in the namespace
258+
with the journaling feature enabled are mirrored.
259+
260+
For example::
261+
262+
$ rbd --cluster site-a mirror pool enable image-pool/namespace-a image --remote-namespace namespace-b
263+
$ rbd --cluster site-b mirror pool enable image-pool/namespace-b image --remote-namespace namespace-a
264+
265+
This will set up image mode mirroring between image-pool/namespace-a on cluster
266+
site-a and image-pool/namespace-b on cluster site-b.
267+
The namespace and remote-namespace pair configured on a cluster must
268+
match the remote-namespace and namespace respectively on the remote cluster.
269+
If the ``--remote-namespace`` option is not provided, the namespace will be
270+
mirrored to a namespace with the same name in the remote pool.
271+
272+
Disable Mirroring
273+
-----------------
274+
275+
To disable mirroring on a namespace with ``rbd``, specify the ``mirror pool disable``
276+
command and the namespace spec::
277+
278+
rbd mirror pool disable {pool-name}/{namespace-name}
279+
280+
When configured in ``image`` mode, any mirror enabled images in the namespace
281+
must be explicitly disabled before disabling mirroring on the namespace.
282+
283+
For example::
284+
285+
$ rbd --cluster site-a mirror pool disable image-pool/namespace-a
286+
$ rbd --cluster site-b mirror pool disable image-pool/namespace-b
287+
234288
Image Configuration
235289
===================
236290

0 commit comments

Comments
 (0)