Ceph RBD mirroring

Check replication

See how much journal data is yet to be replicated, where ‘sas’ is the pool containing the journal data

rados ls -p sas | grep journal | wc -l

Enable mirroring for an image

Step 1 – Enable journaling feature for the image(You can place the journal data on a separate pool)

rbd feature enable sas/ADLWest-R3.raw journaling

Check to see if the journaling flag has applied

[root@adleast-cephreplica ~]# rbd info sas/ADLWest-R3.raw
rbd image 'ADLWest-R3.raw':
        size 128 MB in 32 objects
        order 22 (4096 kB objects)
        block_name_prefix: rbd_data.2e931f238e1f29
        format: 2
        features: layering, exclusive-lock, object-map, fast-diff, deep-flatten, journaling
        flags:
        journal: 2e931f238e1f29
        mirroring state: disabled

Enable mirroring

rbd mirror image enable sas/ADLWest-R3.raw

Check to see if mirroring has applied

[root@adleast-cephreplica ~]# rbd info sas/ADLWest-R3.raw
rbd image 'ADLWest-R3.raw':
        size 128 MB in 32 objects
        order 22 (4096 kB objects)
        block_name_prefix: rbd_data.2e931f238e1f29
        format: 2
        features: layering, exclusive-lock, object-map, fast-diff, deep-flatten, journaling
        flags:
        journal: 2e931f238e1f29
        mirroring state: enabled
        mirroring global id: 1c590dca-9123-4613-95d8-2267338f4e8a
        mirroring primary: true