@@ -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+
3235Mirroring 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
3942Depending on the desired needs for replication, RBD mirroring can be configured
4043for 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+
234288Image Configuration
235289===================
236290
0 commit comments