Managing mirroring on a namespace

Enable and disable Ceph Block Device mirroring on namespaces by using the command-line interface.

Before you begin

Before you begin, make sure that you have root-level access to the node.

About this task

Before configuring a namespace to mirror with a different remote namespace, mirroring must be disabled for both the local and remote namespaces on both the clusters.

Enabling mirroring on a namespace

Before you begin

Before you begin, make sure that you have the following prerequisites in place:
  • 2 running IBM Storage Ceph clusters.
  • rbd-mirror daemon service enabled on both clusters.
  • Mirroring is in enabled for the pool in which the namespace is added.
    Note:

About this task

You can mirror a namespace to a namespace with a different name in the remote pool by using the --remote-namespace option. By default, the namespace is mirrored with the same name on the remote pool.

Procedure

Enable mirroring on a namespace, by using the mirror pool enable command. Be sure to run the command on both peer clusters.
Syntax
rbd mirror pool enable POOL_NAME/LOCAL_NAMESPACE_NAMEMODE --remote-namespace REMOTE_NAMESPACE_NAME
The mirroring mode options are image or pool. The default mirroring mode is pool.
image
When configured in image mode, mirroring must be explicitly enabled on each image.
pool
When configured in pool mode, all images in the namespace with the journaling feature enabled are mirrored.
The namespace and remote namespace on the first cluster must match the remote namespace and namespace respectively on the remote cluster.
Note: If the --remote-namespace option is not provided, the namespace is mirrored to a namespace with the same name in the remote pool.
The following example enables image mode mirroring between image-pool/namespace-a on the first cluster and image-pool/namespace-b on the second, remote, cluster.
[root@rbd-client ~]#  rbd mirror pool enable image-pool/namespace-a image --remote-namespace namespace-b

[root@rbd-client ~]#  rbd mirror pool enable image-pool/namespace-b image --remote-namespace namespace-a

Disabling mirroring on a namespace

Before you begin

Before disabling mirroring, any consistency group mirror enabled images in the namespace must be explicitly disabled before disabling mirroring on the namespace if configured in image mode.

About this task

Disable mirroring on a namespace, by using the mirror pool disable command.

Procedure

Run the following command to disable mirroring on a namespace.
Syntax
rbd mirror pool disable POOL_NAME/NAMESPACE_NAME
Example
[root@rbd-client ~]# rbd mirror pool disable image-pool/namespace-a
[root@rbd-client ~]# rbd mirror pool disable image-pool/namespace-b