7.5.1 配置image属性
在需要备份的主集群上操作
image需要两个属性:exclusive-lock 和 journaling
有三种方法可以配置:
1、在ceph.conf中添加
rbd default features = 125
2、在创建image的时候加上
rbd create <image-name> --size <megabytes> --pool <pool-name> --imagefeature <feature>
例:
rbd create image-1 --size 1024 --pool rbd --image-feature exclusive-lock,journaling
3、对已创建的image开启属性
rbd feature enable <pool-name>/<image-name> <feature-name>
例:
rbd feature enable rbd/image-1 exclusive-lock
rbd feature enable rbd/image-1 journaling
7.5.2 配置文件和密钥文件
在主集群上
cp /etc/ceph/ceph.conf /etc/ceph/local.conf
cp /etc/ceph/ceph.client.admin.keyring /etc/ceph/local.client.admin.keyring
scp ceph0:/etc/ceph/ceph.conf /etc/ceph/remote.conf
scp ceph0:/etc/ceph/ceph.client.admin.keyring /etc/ceph/remote.client.admin.keyring
在备集群上
cp /etc/ceph/ceph.conf /etc/ceph/remote.conf
cp /etc/ceph/ceph.client.admin.keyring /etc/ceph/remote.client.admin.keyring
scp ceph3:/etc/ceph/ceph.conf /etc/ceph/local.conf
scp ceph3:/etc/ceph/ceph.client.admin.keyring /etc/ceph/local.client.admin.keyring
在主备集群上设置权限
chown ceph:ceph -R /etc/ceph
检查设置是否完成
[root@ansible-0 ~]# ceph --cluster local mon stat
e3: 3 mons at {ansible-0=172.20.2.158:6789/0,ansible-1=172.20.2.161:6789/0,ansible-2=172.20.2.160:6789/0}, election epoch 10, quorum 0,1,2 ansible-0,ansible-2,ansible-1
[root@ansible-0 ~]# ceph --cluster remote mon stat
e2: 3 mons at {ceph0=172.20.2.123:6789/0,ceph1=172.20.2.124:6789/0,ceph2=172.20.2.125:6789/0}, election epoch 6, quorum 0,1,2 ceph0,ceph1,ceph2
[root@ceph0 ~]# ceph --cluster local mon stat
e3: 3 mons at {ansible-0=172.20.2.158:6789/0,ansible-1=172.20.2.161:6789/0,ansible-2=172.20.2.160:6789/0}, election epoch 10, quorum 0,1,2 ansible-0,ansible-2,ansible-1
[root@ceph0 ~]# ceph --cluster remote mon stat
e2: 3 mons at {ceph0=172.20.2.123:6789/0,ceph1=172.20.2.124:6789/0,ceph2=172.20.2.125:6789/0}, election epoch 6, quorum 0,1,2 ceph0,ceph1,ceph2
此时两个集群可以通过local和remote进行通信