Chapter 5. Configuring multisite storage replication
Mirroring or replication is enabled on a per CephBlockPool basis within peer managed clusters and can then be configured on a specific subset of images within the pool. The rbd-mirror daemon is responsible for replicating image updates from the local peer cluster to the same image in the remote cluster.
These instructions detail how to create the mirroring relationship between two OpenShift Data Foundation managed clusters.
5.1. Installing OpenShift Data Foundation Multicluster Orchestrator Copy linkLink copied to clipboard!
OpenShift Data Foundation Multicluster Orchestrator is a controller that is installed from OpenShift Container Platform’s OperatorHub on the Hub cluster. This Multicluster Orchestrator controller, along with the MirrorPeer custom resource, creates a bootstrap token and exchanges this token between the managed clusters.
Procedure
- Navigate to OperatorHub on the Hub cluster and use the keyword filter to search for ODF Multicluster Orchestrator.
- Click ODF Multicluster Orchestrator tile.
Keep all default settings and click Install.
The operator resources are installed in
openshift-operatorsand available to all namespaces.Verify that the ODF Multicluster Orchestrator has installed successfully.
- Validate successful installation by having the ability to select View Operator.
Verify that the operator Pod are in
Runningstate.oc get pods -n openshift-operators
$ oc get pods -n openshift-operatorsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
NAME READY STATUS RESTARTS AGE odfmo-controller-manager-65946fb99b-779v8 1/1 Running 0 5m3s
NAME READY STATUS RESTARTS AGE odfmo-controller-manager-65946fb99b-779v8 1/1 Running 0 5m3sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Creating mirror peer on hub cluster Copy linkLink copied to clipboard!
Mirror Peer is a cluster-scoped resource to hold information about the managed clusters that will have a peer-to-peer relationship.
Prerequisites
- Ensure that ODF Multicluster Orchestrator is installed on the Hub cluster.
- You must have only two clusters per Mirror Peer.
-
Ensure that each cluster has uniquely identifiable cluster names such as
ocp4perf1andocp4perf2.
Procedure
Click ODF Multicluster Orchestrator to view the operator details.
You can also click View Operator after the Multicluster Orchestrator is installed successfully.
- Click on Mirror Peer API Create instance and then select YAML view.
Copy and save the following YAML to filename
mirror-peer.yamlafter replacing <cluster1> and <cluster2> with the correct names of your managed clusters in the RHACM console.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe time values (e.g. 5m) for
schedulingIntervalswill be used to configure the desired interval for replicating persistent volumes. These values can be mapped to your Recovery Point Objective (RPO) for critical applications. Modify the values inschedulingIntervalsto be correct for your application requirements. The minimum value is1mand the default is5m.-
Copy the contents of your unique
mirror-peer.yamlfile into theYAML view. You must completely replace the original content. - Click Create at the bottom of the YAML view screen.
-
Verify that you can view Phase status as
ExchangedSecretbefore proceeding.
5.3. Validating Ceph mirroring on managed clusters Copy linkLink copied to clipboard!
Perform the following validations on the Primary managed cluster and the Secondary managed cluster to check Ceph mirroring is active:
Verify that
mirroringis enabled on the defaultCeph block pool.oc get cephblockpool -n openshift-storage -o=jsonpath='{.items[?(@.metadata.ownerReferences[*].kind=="StorageCluster")].spec.mirroring.enabled}{"\n"}'$ oc get cephblockpool -n openshift-storage -o=jsonpath='{.items[?(@.metadata.ownerReferences[*].kind=="StorageCluster")].spec.mirroring.enabled}{"\n"}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
true
trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
rbd-mirrorpod is up and running.oc get pods -o name -l app=rook-ceph-rbd-mirror -n openshift-storage
$ oc get pods -o name -l app=rook-ceph-rbd-mirror -n openshift-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
pod/rook-ceph-rbd-mirror-a-6486c7d875-56v2v
pod/rook-ceph-rbd-mirror-a-6486c7d875-56v2vCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check the status of the
daemonhealth to ensure it is OK.oc get cephblockpool ocs-storagecluster-cephblockpool -n openshift-storage -o jsonpath='{.status.mirroringStatus.summary}{"\n"}'$ oc get cephblockpool ocs-storagecluster-cephblockpool -n openshift-storage -o jsonpath='{.status.mirroringStatus.summary}{"\n"}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
{"daemon_health":"OK","health":"OK","image_health":"OK","states":{}}{"daemon_health":"OK","health":"OK","image_health":"OK","states":{}}Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIt could take up to 10 minutes for the daemon_health and health fields to change from
WarningtoOK. If the status does not become OK after 10 minutes then use the Advanced Cluster Manager console to verify that thesubmariner add-onconnection is still in a healthy state.Verify that VolumeReplicationClass is created on the Primary managed cluster and the Secondary managed cluster for each schedulingIntervals listed in the MirrorPeer (e.g. 5m, 15m).
oc get volumereplicationclass
$ oc get volumereplicationclassCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
NAME PROVISIONER rbd-volumereplicationclass-1625360775 openshift-storage.rbd.csi.ceph.com rbd-volumereplicationclass-539797778 openshift-storage.rbd.csi.ceph.com
NAME PROVISIONER rbd-volumereplicationclass-1625360775 openshift-storage.rbd.csi.ceph.com rbd-volumereplicationclass-539797778 openshift-storage.rbd.csi.ceph.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe
VolumeReplicationClassis used to specify themirroringModefor each volume to be replicated as well as how often a volume or image is replicated (for example, every 5 minutes) from the local cluster to the remote cluster.
5.4. Validating object buckets and S3StoreProfiles Copy linkLink copied to clipboard!
Perform the following validations on the Primary managed cluster and the Secondary managed cluster to check Ceph mirroring is active.
Procedure
Verify that there is a new Object Bucket Claim and corresponding Object Bucket in the Primary managed cluster and the Secondary managed cluster in the
openshift-storagenamespace.oc get obc,ob -n openshift-storage
$ oc get obc,ob -n openshift-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
NAME STORAGE-CLASS PHASE AGE objectbucketclaim.objectbucket.io/odrbucket-21eb5332f6b6 openshift-storage.noobaa.io Bound 13m NAME STORAGE-CLASS CLAIM-NAMESPACE CLAIM-NAME RECLAIM-POLICY PHASE AGE objectbucket.objectbucket.io/obc-openshift-storage-odrbucket-21eb5332f6b6 openshift-storage.noobaa.io Delete Bound 13m
NAME STORAGE-CLASS PHASE AGE objectbucketclaim.objectbucket.io/odrbucket-21eb5332f6b6 openshift-storage.noobaa.io Bound 13m NAME STORAGE-CLASS CLAIM-NAMESPACE CLAIM-NAME RECLAIM-POLICY PHASE AGE objectbucket.objectbucket.io/obc-openshift-storage-odrbucket-21eb5332f6b6 openshift-storage.noobaa.io Delete Bound 13mCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that there are two new Secrets in the Hub cluster
openshift-dr-systemnamespace that contain the access and secret key for each new Object Bucket Class.oc get secrets -n openshift-dr-system | grep Opaque
$ oc get secrets -n openshift-dr-system | grep OpaqueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
8b3fb9ed90f66808d988c7edfa76eba35647092 Opaque 2 16m af5f82f21f8f77faf3de2553e223b535002e480 Opaque 2 16m
8b3fb9ed90f66808d988c7edfa76eba35647092 Opaque 2 16m af5f82f21f8f77faf3de2553e223b535002e480 Opaque 2 16mCopy to Clipboard Copied! Toggle word wrap Toggle overflow The OBC and Secrets are written in the ConfigMap
ramen-hub-operator-configon the Hub cluster in the newly createds3StoreProfilessection.oc get cm ramen-hub-operator-config -n openshift-dr-system -o yaml | grep -A 14 s3StoreProfiles
$ oc get cm ramen-hub-operator-config -n openshift-dr-system -o yaml | grep -A 14 s3StoreProfilesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteRecord the names of the
s3ProfileName. They will be used in the DRPolicy resource.