Rate This Document
Findability
Accuracy
Completeness
Readability

Integrating Ceph Object Storage with OpenStack

Configuring the Ceph Environment

  1. Run the following command on ceph1 to modify the /etc/ceph/ceph.conf configuration file:
    1
    vim /etc/ceph/ceph.conf
    

    Add 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.

  2. Run the following command on ceph1 to synchronize configuration files on all cluster nodes:
    1
    ceph-deploy --overwrite-conf admin ceph1 ceph2 ceph3
    
  3. 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
    
  4. After the preceding command is successfully executed, check whether the RGW service is successfully started on each Ceph node.
    1
    netstat -ntlp | grep radosgw
    

  5. 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
    
  6. Check whether the storage pools are created successfully.
    1
    ceph osd pool ls
    

  7. Run the following command on ceph1 to create an admin user for the Ceph object storage gateway:
    1
    radosgw-admin user create --uid="testuser" --display-name="First User"
    
  8. Run the following command on ceph1 to create a Swift sub-user for the Ceph object storage gateway:
    1
    radosgw-admin subuser create --uid=testuser --subuser=testuser:swift --access=full
    

Configuring Swift to Integrate Ceph

  1. 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:
    1
    openstack endpoint delete SWIFT_ENDPOINT_ID
    

    SWIFT_ENDPOINT_ID is the first ID in the Swift endpoint list.

  2. 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"
    
  3. Run the swift list command on the controller node. If no error is reported, the integration of Swift and Ceph is complete.
    1
    swift list