3.3. 配置 Cinder 备份以使用 Ceph 块设备
红帽 OpenStack 平台可以将 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, }