7.5.5 开启mirror模式

主备集群中都执行

开启集群pool备份模式

rbd mirror pool enable <pool-name> <mode>

对rbd存储池启动image模式的mirror配置

rbd mirror pool enable rbd pool

开启集群image备份模式

rbd mirror image enable <pool-name>/<image>

这里开启具体的image mirror

[root@ansible-0 ~]# rbd mirror image enable rbd/image-1
Mirroring enabled

查询镜像的状态

[root@ansible-0 ~]# rbd info rbd/image-1
rbd image 'image-1':
    size 1024 MB in 256 objects
    order 22 (4096 kB objects)
    block_name_prefix: rbd_data.108b238e1f29
    format: 2
    features: exclusive-lock, journaling
    flags:
    journal: 108b238e1f29
    mirroring state: enabled
    mirroring global id: c603d9dc-6f8d-49e0-ab68-5944d348e527
    mirroring primary: true

查看镜像同步

查看镜像同步的状态

[root@ansible-0 ~]# rbd mirror image status rbd/image-1 --cluster remote
image-1:
  global_id:   c603d9dc-6f8d-49e0-ab68-5944d348e527
  state:       up+replaying
  description: replaying, master_position=[object_number=3, tag_tid=1, entry_tid=3], mirror_position=[object_number=3, tag_tid=1, entry_tid=3], entries_behind_master=0
  last_update: 2017-06-05 17:00:41

syncing表示正在同步,同步完成后状态为replaying

检查数据是否同步,在备上查看

[root@ceph0 ~]# rbd info rbd/image-1
rbd image 'image-1':
    size 1024 MB in 256 objects
    order 22 (4096 kB objects)
    block_name_prefix: rbd_data.106b12200854
    format: 2
    features: exclusive-lock, journaling
    flags:
    journal: 106b12200854
    mirroring state: enabled
    mirroring global id: c603d9dc-6f8d-49e0-ab68-5944d348e527
    mirroring primary: false

说明已经同步了

results matching ""

    No results matching ""