Using s3cmd with Eucalyptus

Follow

Eucalyptus Versions:  3.4 and above.

Tested with s3cmd-1.5.0-rc1

Introduction

s3cmd is a command-line S3 client written in python for Linux and Mac.

Pre-requisites

DNS must be enabled on your cloud [1], this is required for DNS bucket names.  

You will also need to download the s3cmd software [2] and unpack it into a directory and run the following command to install it on your host:
python setup.py install

Configuring s3cmd

s3cmd has a useful configuration option which will generate an initial .s3cfg file for your current user. Source your eucarc credentials obtained from the Eucalyptus platform and then run s3cmd with the --configure parameter:

s3cmd --configure

Accept all defaults, choose no for HTTPS and no when asked to test your settings. s3cmd will pick up your access key and secret key via your environmental variables (remember you sourced your eucarc).

At this point, you just need to make a small edit to the configuration file to add the hostname of your object storage platform. Open up the .s3cfg file and configure like so:

host_base = objectstorage.wizards.prc.eucalyptus-systems.com:8773
host_bucket = %(bucket)s.objectstorage.wizards.prc.eucalyptus-systems.com:8773

Testing s3cmd

You should be all set. Run the following command to list buckets:

s3cmd ls

Now try and create a bucket and list the objects inside (there should be none):

s3cmd mb s3://testbucket
s3cmd ls s3://testbucket

References

[1] https://www.eucalyptus.com/docs/eucalyptus/4.0/index.html#shared/setting_up_dns.html

[2] http://s3tools.org/s3cmd

Have more questions? Submit a request

Comments

  • Avatar
    Bruno Cornec

    With the recent change of Amazon signature version, you need to change in your ~/.s3cfg the following line:

    signature_v2 = False

    to

    signature_v2 = True

    for the mb command (and the following) to work.

  • Avatar
    Bruno Cornec
Powered by Zendesk