Integrating Ceph Object Storage with OpenStack
Configuring the Ceph Environment
- Run the following command on ceph1 to modify the /etc/ceph/ceph.conf configuration file:
1vim /etc/ceph/ceph.confAdd the following content to the file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
[client.rgw.ceph1] host=ceph1 log file=/var/log/radosgw/client.radosgw.gateway.log rgw_frontends = civetweb port=10001 rgw keystone api version = 3 rgw keystone url = http://controller:5000 rgw keystone accepted roles = admin rgw keystone token cache size = 500 rgw keystone revocation interval = 300 rgw keystone implicit tenants = true rgw s3 auth use keystone = true rgw keystone admin user = admin rgw keystone admin password = <PASSWORD> rgw keystone admin tenant = admin rgw keystone admin domain = default [client.rgw.ceph2] host=ceph2 log file=/var/log/radosgw/client.radosgw.gateway.log rgw_frontends = civetweb port=10002 rgw keystone api version = 3 rgw keystone url = http://controller:5000 rgw keystone accepted roles = admin rgw keystone token cache size = 500 rgw keystone revocation interval = 300 rgw keystone implicit tenants = true rgw s3 auth use keystone = true rgw keystone admin user = admin rgw keystone admin password = <PASSWORD> rgw keystone admin tenant = admin rgw keystone admin domain = default [client.rgw.ceph3] host=ceph3 log file=/var/log/radosgw/client.radosgw.gateway.log rgw_frontends = civetweb port=10003 rgw keystone api version = 3 rgw keystone url = http://controller:5000 rgw keystone accepted roles = admin rgw keystone token cache size = 500 rgw keystone revocation interval = 300 rgw keystone implicit tenants = true rgw s3 auth use keystone = true rgw keystone admin user = admin rgw keystone admin password = <PASSWORD> rgw keystone admin tenant = admin rgw keystone admin domain = default
PASSWORD indicates the password of rgw keystone admin. Use the actual value.
- Run the following command on ceph1 to synchronize configuration files on all cluster nodes:
1ceph-deploy --overwrite-conf admin ceph1 ceph2 ceph3
- Run the following command on the ceph1 node to create an RGW instance for each of the three Ceph nodes:
1 2 3
ceph-deploy rgw create ceph1:ceph1 ceph-deploy rgw create ceph2:ceph2 ceph-deploy rgw create ceph3:ceph3
- After the preceding command is successfully executed, check whether the RGW service is successfully started on each Ceph node.
1netstat -ntlp | grep radosgw

- On the ceph1 node, create object storage pools and set the PG and placement group for placement (PGP) values.
1 2
ceph osd pool create default.rgw.buckets.data 64 64 ceph osd pool create default.rgw.buckets.index 16 16
- Check whether the storage pools are created successfully.
1ceph osd pool ls

- Run the following command on ceph1 to create an admin user for the Ceph object storage gateway:
1radosgw-admin user create --uid="testuser" --display-name="First User"
- Run the following command on ceph1 to create a Swift sub-user for the Ceph object storage gateway:
1radosgw-admin subuser create --uid=testuser --subuser=testuser:swift --access=full
Configuring Swift to Integrate Ceph
- Run the following commands on the OpenStack controller node to check the endpoint of the Swift storage in the OpenStack environment:
1 2
source /etc/keystone/admin-openrc openstack endpoint list | grep swift
- If no Swift endpoint exists in the environment, go to the next step to create an endpoint.
- If a Swift endpoint exists in the environment, run the following command to delete the existing Swift endpoint:
1openstack endpoint delete SWIFT_ENDPOINT_ID
SWIFT_ENDPOINT_ID is the first ID in the Swift endpoint list.
- Run the following commands on the controller node to create an OpenStack endpoint with the URL pointing to the ceph1 RGW port:
1 2 3
openstack endpoint create --region RegionOne object-store public "http://ceph1:10001/swift/v1" openstack endpoint create --region RegionOne object-store internal "http://ceph1:10001/swift/v1" openstack endpoint create --region RegionOne object-store admin "http://ceph1:10001/swift/v1"
- Run the swift list command on the controller node. If no error is reported, the integration of Swift and Ceph is complete.
1swift list
Parent topic: Integrating Ceph with OpenStack