Support #24818
RBD mirroring delay replication
0%
Description
Hi guys,
I'm testing feature delay replication of rbd mirroring in mimic release. I have configurated my cluster flowing guide of redhat https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/3/html/block_device_guide/block_device_mirroring
I configurated successfully rbd mirroring for two clusters, named ceph and backup. So, i want to configurate feature delay replication. I've worked steps as flowing:
step 1: create a image in ceph cluster
rbd -p data create disk-0 --size 1024 --image-feature exclusive-lock,journaling
result on both cluster have a image named disk-0 in data pool.
step 2: config delay replication for image
rbd image-meta set data/disk-0 conf_rbd_mirroring_replay_delay 600
step 3: i tested the delay replication by deleting disk-0 image in ceph cluster
rbd -p data remove disk-0
if configuration delay replication was succesfull, then 600 seconds disk-0 on backup cluster is deleted. But the image is deleted immediately.
In other use case, i changed in file config on both clusters. In global section, i added `rbd mirroring replay delay = 600` and restart ceph-mon daemon. The daemon ceph-mon running with config mirroring delay:
$ ceph daemon /var/run/ceph/ceph-mon.ceph.asok config show | grep mirroring
"rbd_mirroring_delete_delay": "0",
"rbd_mirroring_replay_delay": "600",
"rbd_mirroring_resync_after_disconnect": "false",
When i create a rbd image in ceph cluster, the image is replicated immediately in backup cluster.
Please help me handle the problem.
Thanks.
History
#1 Updated by Jason Dillaman over 5 years ago
The "rbd_mirroring_replay_delay" won't delay the initial full image synchronization, it only delays the replaying of the image's journal. Additionally, "rbd_mirroring_delete_delay" controls the deletion delay -- but the image is always immediately moved to the RBD trash so that a new image of the same name could be instantly created and replicated.
#2 Updated by duc pham over 5 years ago
Thank Jason Dillaman,
May i restore the image in RBD trash?
And i want to know what the purpose of delay image's journal. What case is the feature applied?
Thanks.
#3 Updated by Jason Dillaman over 5 years ago
duc pham wrote:
May i restore the image in RBD trash?
Yup, the rbd trash feature wouldn't be very useful if you couldn't restore images from the trash.
And i want to know what the purpose of delay image's journal. What case is the feature applied?
Certain use-cases where you want to ensure that the DR site is always X amount of time behind the master.
#4 Updated by duc pham over 5 years ago
I set rbd_mirroring_delete_delay = 3600, but when i use the command:
rbd -p data remove image
to delete image. The image is complete deleted, not move to trash. The image just move to trash when i use the command:
rbd trash -p data move image
the image will move to trash. please help me explain the problem. I don't know what i wrong in configuration. Thanks.
#5 Updated by Jason Dillaman over 5 years ago
- Status changed from New to Need More Info
How and where did you configure "rbd_mirroring_delete_delay"? This value should be set on the remote site's ceph.conf (or on each image being replicated).
#6 Updated by duc pham over 5 years ago
I set rbd_mirroring_delete_delay in "[global]" section ceph.conf on both site.
when I run command "rbd -p data remove image" on primary site. The image is completely deleted on both sites.
#7 Updated by Jason Dillaman over 5 years ago
Did you restart the rbd-mirror daemon after making a configuration change? It only reads the on-disk configuration at start up.
#8 Updated by duc pham over 5 years ago
I restarted all the ceph's services on both sites.
#9 Updated by duc pham over 5 years ago
Maybe I configured wrong somewhere. Do you have a script or guide about delay rbd mirroring lab? I want to try to config it again for detecting in my lab.
Thank you.
#10 Updated by Jason Dillaman over 5 years ago
- Tracker changed from Feature to Support
- Status changed from Need More Info to New
I don't know what you are doing, but it works for me:
$ date ; rbd --cluster cluster2 --pool mirror mirror image status image Thu Jul 19 13:50:40 EDT 2018 image: global_id: 74f9103b-fc63-4af8-9039-17c1b6f2c775 state: up+replaying description: replaying, master_position=[object_number=8, tag_tid=2, entry_tid=38240], mirror_position=[object_number=10, tag_tid=2, entry_tid=46250], entries_behind_master=0 last_update: 2018-07-19 13:50:12 $ date ; rbd --cluster cluster1 --pool mirror rm image Thu Jul 19 13:51:18 EDT 2018 Removing image: 100% complete...done. $ date ; rbd --cluster cluster2 --pool mirror info image Thu Jul 19 13:51:33 EDT 2018 rbd: error opening image image: (2) No such file or directory $ date ; rbd --cluster cluster2 --pool mirror trash list --all --format json --pretty-format Thu Jul 19 13:52:08 EDT 2018 [ { "id": "10346b8b4567", "name": "image" } ] $ rbd --cluster cluster2 --pool mirror trash restore --image new_image_name 10346b8b4567 $ rbd --cluster cluster2 --pool mirror ls new_image_name
#11 Updated by duc pham over 5 years ago
Thank you so much. I detected my problem. I checked the trash in the primary cluster. I checked again in the secondary cluster, it worked for me.
#12 Updated by Jason Dillaman over 5 years ago
- Status changed from New to Closed