Deploying RGW

We will use the Ansible lab deployed in Chapter 2Deploying Ceph with Containers, to deploy a RGW.

First, edit the /etc/ansible/hosts file and add the rgws role to the mon3 VM:

We also need to update the /etc/ansible/group_vars/ceph file to add the radosgw_address variable; it will be set to [::], which means bind to all IPv4 and IPv6 interfaces:

Now run the Ansible playbook again:

ansible-playbook -K site.yml

After running, you should see it has successfully deployed the RGW component:

Viewing the Ceph status from a monitor node, we can check that the RGW service has registered with the Ceph cluster and is operational:

Now that the RGW is active, a user account is required to interact with the S3 API, and this can be created using the radosgw-admin tool shown as follows:

sudo radosgw-admin user create --uid=johnsmith --display-name="John Smith" [email protected]

Note the output from the command, particularly the access_key and secret_key, these are used with S3 clients to authenticate with the RGW.

To upload objects to our S3-capable Ceph cluster, we first need to create an S3 bucket. We will use the s3cmd tool to do this, which is shown as follows:

sudo apt-get install s3cmd

Now that s3cmd is installed, it needs to be configured to point at our RGW server; it has a built-in configuration tool that can be used to generate the initial configuration. During the configuration wizard, it will prompt for the access key and secret that was generated when the user account was created, which is shown as follows:

s3cmd --configure

The generated configuration will be pointing to Amazon's S3 service; the generated configuration file needs to be edited and a few options modified. Edit the .s3cfg file in your Linux user's home directory and make the following changes:

nano .s3cfg

Comment out the bucket_location variable:

Change the host_base and host_buckets to match the address of the RGW:

Save the file and quit back to the shell; s3cmd can now be used to manipulate your s3 storage. The following example will create a test bucket where objects can be uploaded:

s3cmd mb s3://test

You now have a fully functional S3-compatible storage platform ready to explore the world of object storage.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.186.83