CentOS Stream 9
Sponsored Link

OpenStack Caracal : Configure Swift (Control Node)2024/08/07

 

Configure OpenStack Object Storage (Swift).

This example is based on the environment like follows.

------------+--------------------------+------------
            |                          |
        eth0|10.0.0.30             eth0|10.0.0.50
+-----------+-----------+  +-----------+-----------+
|   [ dlp.srv.world ]   |  | [ network.srv.world ] |
|     (Control Node)    |  |      (Proxy Node)     |
|                       |  |                       |
|  MariaDB    RabbitMQ  |  |      Swift Proxy      |
|  Memcached  Nginx     |  |         Nginx         |
|  Keystone   httpd     |  |                       |
+-----------------------+  +-----------------------+

------------+--------------------------+--------------------------+-----------
        eth0|10.0.0.71             eth0|10.0.0.72             eth0|10.0.0.73
+-----------+-----------+  +-----------+-----------+  +-----------+-----------+
|  [snode01.srv.world]  |  |  [snode02.srv.world]  |  |  [snode03.srv.world]  |
|    (Storage Node#1)   |  |    (Storage Node#2)   |  |    (Storage Node#3)   |
|                       |  |                       |  |                       |
|     Swift-Account     |  |     Swift-Account     |  |     Swift-Account     |
|    Swift-Container    |  |    Swift-Container    |  |    Swift-Container    |
|     Swift-Object      |  |     Swift-Object      |  |     Swift-Object      |
+-----------------------+  +-----------------------+  +-----------------------+

[1] Add Swift user or service on Keystone Server (Control Node) first.
# create [swift] user in [service] project

[root@dlp ~(keystone)]#
openstack user create --domain default --project service --password servicepassword swift

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | 0b826f1bf49d489494e94badc32f2cea |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | c6055eb5ecd84464b2f2555da10c8d71 |
| name                | swift                            |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# add [swift] user in [admin] role

[root@dlp ~(keystone)]#
openstack role add --project service --user swift admin
# create service entry for [swift]

[root@dlp ~(keystone)]#
openstack service create --name swift --description "OpenStack Object Storage" object-store

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Object Storage         |
| enabled     | True                             |
| id          | e50a8a2cfa87460fbb7bb7f13d14e05f |
| name        | swift                            |
| type        | object-store                     |
+-------------+----------------------------------+

# define Swift Proxy Host

[root@dlp ~(keystone)]#
export swift_proxy=network.srv.world
# create endpoint for [swift] (public)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne object-store public https://$swift_proxy:8080/v1/AUTH_%\(project_id\)s

+--------------+-------------------------------------------------------+
| Field        | Value                                                 |
+--------------+-------------------------------------------------------+
| enabled      | True                                                  |
| id           | 99ab09866790497c8fe22a6c13a34e91                      |
| interface    | public                                                |
| region       | RegionOne                                             |
| region_id    | RegionOne                                             |
| service_id   | e50a8a2cfa87460fbb7bb7f13d14e05f                      |
| service_name | swift                                                 |
| service_type | object-store                                          |
| url          | https://network.srv.world:8080/v1/AUTH_%(project_id)s |
+--------------+-------------------------------------------------------+

# create endpoint for [swift] (internal)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne object-store internal https://$swift_proxy:8080/v1/AUTH_%\(project_id\)s

+--------------+-------------------------------------------------------+
| Field        | Value                                                 |
+--------------+-------------------------------------------------------+
| enabled      | True                                                  |
| id           | 7b7aa9bccf25422293bf42ee52119123                      |
| interface    | internal                                              |
| region       | RegionOne                                             |
| region_id    | RegionOne                                             |
| service_id   | e50a8a2cfa87460fbb7bb7f13d14e05f                      |
| service_name | swift                                                 |
| service_type | object-store                                          |
| url          | https://network.srv.world:8080/v1/AUTH_%(project_id)s |
+--------------+-------------------------------------------------------+

# create endpoint for [swift] (admin)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne object-store admin https://$swift_proxy:8080/v1

+--------------+-----------------------------------+
| Field        | Value                             |
+--------------+-----------------------------------+
| enabled      | True                              |
| id           | 97b8477256754d7d87c217ff7c306869  |
| interface    | admin                             |
| region       | RegionOne                         |
| region_id    | RegionOne                         |
| service_id   | e50a8a2cfa87460fbb7bb7f13d14e05f  |
| service_name | swift                             |
| service_type | object-store                      |
| url          | https://network.srv.world:8080/v1 |
+--------------+-----------------------------------+
Matched Content