Bookmark this page

Guided Exercise: Deploying an Object Storage Gateway

In this exercise, you will deploy a RADOS Gateway and verify client access.

Outcomes

You should be able to deploy a Ceph RADOS Gateway by using the Ceph orchestrator.

As the student user on the workstation machine, use the lab command to prepare your system for this exercise.

[student@workstation ~]$ lab start object-radosgw

This command confirms that the hosts required for this exercise are accessible.

Procedure 8.1. Instructions

  1. Log in to clienta as the admin user and use sudo to run the cephadm shell. Verify the health of the cluster.

    [student@workstation ~]$ ssh admin@clienta
    [admin@clienta ~]$ sudo cephadm shell
    [ceph: root@clienta /]# ceph health
    HEALTH_OK
  2. View the cluster services. Verify that there are no rgw services running.

    [ceph: root@clienta /]# ceph orch ls
    NAME                     RUNNING  REFRESHED  AGE  PLACEMENT
    alertmanager                 1/1  92s ago    2d   count:1
    crash                        4/4  4m ago     2d   *
    grafana                      1/1  92s ago    2d   count:1
    mgr                          4/4  4m ago     2d   ...;servere.lab.example.com
    mon                          4/4  4m ago     2d   ...;servere.lab.example.com
    node-exporter                4/4  4m ago     2d   *
    osd.default_drive_group     9/12  93s ago    2d   server*
    prometheus                   1/1  92s ago    2d   count:1
    [ceph: root@clienta /]# ceph orch ls --service-type rgw
    No services reported
  3. Create the rgw_service.yaml file. Configure the service to start two RGW instances in each of the serverd and servere hosts. The ports of the RGW instances must start from port 8080. Your file should look like this example.

    [ceph: root@clienta /]# cat rgw_service.yaml
    service_type: rgw
    service_id: myrealm.myzone
    service_name: rgw.myrealm.myzone
    placement:
      count: 4
      hosts:
      - serverd.lab.example.com
      - servere.lab.example.com
    spec:
      rgw_frontend_port: 8080
  4. Use the Ceph orchestrator to create an RGW service with the rgw_service.yaml file. View the cluster and RGW service status. Verify that there are two daemons per host.

    1. Use Ceph orchestrator to create the RGW service with the rgw_service.yaml file.

      [ceph: root@clienta /]# ceph orch apply -i rgw_service.yaml
      Scheduled rgw.myrealm.myzone update...
    2. View the cluster status and find the status of the new RGW service daemons.

      [ceph: root@clienta /]# ceph status
        cluster:
          id:     2ae6d05a-229a-11ec-925e-52540000fa0c
          health: HEALTH_OK
      
        services:
          mon: 4 daemons, quorum serverc.lab.example.com,clienta,serverd,servere (age 4m)
          mgr: serverc.lab.example.com.aiqepd(active, since 10m), standbys: clienta.nncugs, serverd.klrkci
          osd: 9 osds: 9 up (since 8m), 9 in (since 9m)
          rgw: 4 daemons active (2 hosts, 1 zones)
      ...output omitted...
    3. Verify that the orchestrator created two running daemons per node.

      [ceph: root@clienta /]# ceph orch ps --daemon-type rgw
      NAME                               HOST                     STATUS         REFRESHED  AGE  PORTS   ...
      rgw.myrealm.myzone.serverd.tknapl  serverd.lab.example.com  running (14s)  0s ago     14s  *:8080  ...
      rgw.myrealm.myzone.serverd.xpabfe  serverd.lab.example.com  running (6s)   0s ago     6s   *:8081  ...
      rgw.myrealm.myzone.servere.lwusbq  servere.lab.example.com  running (18s)  0s ago     17s  *:8080  ...
      rgw.myrealm.myzone.servere.uyginy  servere.lab.example.com  running (10s)  0s ago     10s  *:8081  ...
  5. Log in to the serverd node and view the running containers. Filter the running container processes to find the RGW container. Verify that the Beast embedded web server is accessible on port 8080 and also on port 8081.

    1. Exit the cephadm shell. Log in to serverd as the admin user and switch to the root user. List the running containers, filtered to find the RGW container.

      [ceph: root@clienta /]# exit
      [admin@clienta ~]$ ssh admin@serverd
      admin@serverd's password: redhat
      ...output omitted...
      [admin@serverd ~]$ sudo -i
      [root@serverd ~]# podman ps -a --format "{{.ID}} {{.Names}}" | grep rgw
      7e99b444305d ceph-2ae6d05a-229a-11ec-925e-52540000fa0c-rgw-myrealm-myzone-serverd-xpabfe
      dba722fb413c ceph-2ae6d05a-229a-11ec-925e-52540000fa0c-rgw-myrealm-myzone-serverd-tknapl
    2. Verify that the Beast embedded web server is accessible on port 8080, and also on port 8081. If the gateway is working, you will receive a tagged response.

      [root@serverd ~]# curl http://serverd:8080
      <?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>anonymous</ID><DisplayName></DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult>
      [root@serverd ~]# curl http://serverd:8081
      <?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>anonymous</ID><DisplayName></DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult>
  6. Return to workstation as the student user.

    [root@serverd ~]# exit
    [admin@serverd ~]$ exit
    [admin@clienta ~]$ exit
    [student@workstation ~]$

Finish

On the workstation machine, use the lab command to complete this exercise. This is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish object-radosgw

This concludes the guided exercise.

Revision: cl260-5.0-29d2128