在任何数据可以从 Ceph 集群镜像到 backup 集群之前,我们首先需要在 backup 集群上安装 rbd-mirror 守护程序,启用在数据池上进行镜像,然后将对等集群添加到池中:
- On ceph-node5 in the backup cluster install and configure the rbd-mirror. The client ID of remote (our user) is what the rbd-mirror daemon will use:
- Enable mirroring of the whole pool named data in cluster ceph. The syntax is as follows:
- Enable mirroring of the whole pool named rbd in the cluster backup:
- For the rbd-mirror daemon to discover it's peer cluster, we now must register the peer to the pool. We will need to add the ceph cluster as a peer to the backup cluster. The syntax is as follows:
- Next, we will validate the peer relationship between the pools and the cluster. The syntax is as follows:
现在在池级别为 ceph 和 backup 集群中的池数据启用了镜像,并且为集群中的数据池配置了池对等体 backup
。
- Review the data pool in each cluster and see there are currently no RBD images in either site. Once verified we will create three new RBD images in the data pool with exclusive-lock and journaling enabled and watch them sync to the secondary backup cluster:
-
- Pool mirrors can be polled for a status of the images as they sync to the backup cluster:
-
- Viewing the remote site for before and after on the data pool:
-
- Viewing the image sync status on the remote site:
-
- Viewing the healthy state of the journal replaying the image on the remote site:
重放是我们希望看到的图像状态,因为这意味着 rbd-mirror 守护进程看到同步的图像,并且正在重放日志以对需要同步的图像进行任何更改。
- We will now delete the three images from the ceph cluster and watch as they are removed from the backup cluster:
- Viewing the pool status to validate the images are removed from the remote site:
如果您在任何时候选择禁用池上的镜像,这可以通过所选池的 rbd mirror peer remove 和 rbd mirror pool disable 命令来完成。请注意,当池禁用镜像时,您也会禁用池中任何映像的镜像。
以下是删除镜像的语法:
-
- To remove peer:
-
- To remove mirroring on pool: