Performed on the monitor ceph
CINDER_PASSWD='cinder1234!'
controllerHost='controller'
RABBIT_PASSWD='0penstackRMQ'
1. Create a pool pool
Cinder-backup service create pool pool (OSD because I have only one node, the number of copies you want to set to 1)
Ceph the OSD pool the Create cinder-backup 32
Ceph the OSD pool the SET cinder-backup size 1
Ceph enable the OSD pool the Application cinder-backup rbd
2. Review the use of pool pool
ceph df
3. Create an account
ceph auth get-or-create client.cinder-backup mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=cinder-volumes, allow rwx pool=cinder-backup' -o /etc/ceph/ceph.client.cinder-backup.keyring
#查看
ceph auth ls | grep -EA3 'client.(cinder-backup)'
4. Modify ceph.conf profile monitors and synchronized to all nodes (this step must be operated)
su - cephd
cd ~/ceph-cluster/
cat <<EOF>> ceph.conf
[client.cinder-backup]
keyring = /etc/ceph/ceph.client.cinder-backup.keyring
EOF
ceph-deploy --overwrite-conf admin ceph-mon01
exit
The installation and assembly ceph cinder-backup client (if ceph monitor is not necessary to perform this step on the control node)
yum -y install openstack-cinder python-keystone ceph-common
6. Configure cinder-backup service with cinder-api service to interact
openstack-config --set /etc/cinder/cinder.conf DEFAULT transport_url rabbit://openstack:${RABBIT_PASSWD}@${controllerHost}:5672
openstack-config --set /etc/cinder/cinder.conf cache backend oslo_cache.memcache_pool
openstack-config --set /etc/cinder/cinder.conf cache enabled true
openstack-config --set /etc/cinder/cinder.conf cache memcache_servers ${controllerHost}:11211
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://${controllerHost}:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://${controllerHost}:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name service
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password ${CINDER_PASSWD}
openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp
7. Configure backend storage cinder-backup service used for ceph
openstack-config --set /etc/cinder/cinder.conf DEFAULT enabled_backends ceph
8. Configuration Service cinder-backup drive ceph
openstack-config --set /etc/cinder/cinder.conf DEFAULT backup_driver cinder.backup.drivers.ceph
openstack-config --set /etc/cinder/cinder.conf DEFAULT backup_ceph_chunk_size 134217728 #128Mb
openstack-config --set /etc/cinder/cinder.conf DEFAULT backup_ceph_conf /etc/ceph/ceph.conf
openstack-config --set /etc/cinder/cinder.conf DEFAULT backup_ceph_pool cinder-backup
openstack-config --set /etc/cinder/cinder.conf DEFAULT backup_ceph_user cinder-backup
openstack-config --set /etc/cinder/cinder.conf DEFAULT backup_ceph_stripe_count 0
openstack-config --set /etc/cinder/cinder.conf DEFAULT backup_ceph_stripe_unit 0
openstack-config --set /etc/cinder/cinder.conf DEFAULT restore_discard_excess_bytes True
9. Start cinder.backup Service
systemctl enable openstack-cinder-backup
systemctl start openstack-cinder-backup
systemctl status openstack-cinder-backup