3.2. 配置 Cinder 备份以使用 Ceph 块设备
Red Hat OpenStack Platform 可以配置 Cinder 备份以使用 Ceph 块设备。
先决条件
- Cinder 节点的根级别访问权限。
流程
编辑 Cinder 配置文件:
[root@cinder ~]# vim /etc/cinder/cinder.conf
-
前往 配置文件的
[ceph]部分。 指定
backup_driver设置,并将其设置为 Ceph 驱动程序:backup_driver = cinder.backup.drivers.ceph
指定
backup_ceph_conf设置并指定 Ceph 配置文件的路径:backup_ceph_conf = /etc/ceph/ceph.conf
注意Cinder 备份 Ceph 配置文件可能与用于 Cinder 的 Ceph 配置文件不同。例如,它可以指向不同的 Ceph 存储集群。
指定用于备份的 Ceph 池:
backup_ceph_pool = backups
注意用于 Cinder 备份的 Ceph 配置文件可能与用于 Cinder 的 Ceph 配置文件不同。
指定
backup_ceph_user设置,并将用户指定为cinder-backup:backup_ceph_user = cinder-backup
指定以下设置:
backup_ceph_chunk_size = 134217728 backup_ceph_stripe_unit = 0 backup_ceph_stripe_count = 0 restore_discard_excess_bytes = true
当您包含 Cinder 选项时,
cinder.conf文件的[ceph]部分可能类似如下:示例
[ceph] volume_driver = cinder.volume.drivers.rbd.RBDDriver rbd_cluster_name = ceph rbd_pool = volumes rbd_user = cinder rbd_ceph_conf = /etc/ceph/ceph.conf rbd_flatten_volume_from_snapshot = false rbd_secret_uuid = 4b5fd580-360c-4f8c-abb5-c83bb9a3f964 rbd_max_clone_depth = 5 rbd_store_chunk_size = 4 rados_connect_timeout = -1 backup_driver = cinder.backup.drivers.ceph backup_ceph_user = cinder-backup backup_ceph_conf = /etc/ceph/ceph.conf backup_ceph_chunk_size = 134217728 backup_ceph_pool = backups backup_ceph_stripe_unit = 0 backup_ceph_stripe_count = 0 restore_discard_excess_bytes = true
验证 Cinder 备份是否已启用:
[root@cinder ~]# cat /etc/openstack-dashboard/local_settings | grep enable_backup
如果
enable_backup设为False,则编辑local_settings文件并将其设置为True。示例
OPENSTACK_CINDER_FEATURES = { 'enable_backup': True, }