openstackopenstack-swifts3cmd

Is it possible to interact via s3cmd with a single node deployment of OpenStack Swift


I deployed the storage service OpenStack Swift ontop of a Raspberry Pi 3 with Raspbian = Debian Jessie 8.0. (Thanks to Swift on Pi, the installation was no a big issue).

$ curl -i -H "X-Auth-User: test:tester" -H "X-Auth-Key: testing" http://10.0.0.253:8080/auth/v1.0/
HTTP/1.1 200 OK
X-Storage-Url: http://10.0.0.253:8080/v1/AUTH_test
X-Auth-Token-Expires: 77438
X-Auth-Token: AUTH_tka8fff6782f86486a84e3905daa60f308
Content-Type: text/html; charset=UTF-8
X-Storage-Token: AUTH_tka8fff6782f86486a84e3905daa60f308
Content-Length: 0
X-Trans-Id: txa21566e67e8143b1b32db-005908cf2f
X-Openstack-Request-Id: txa21566e67e8143b1b32db-005908cf2f
Date: Tue, 02 May 2017 18:25:51 GMT

I have no futher OpenStack services (like Keystone) running. Only Swift.

My aim is to use s3cmd to interact with the Swift service.

I modified inside the ~/.s3cfg file these values:

access_key = tester
host_base = 10.0.0.253:8080
host_bucket = 10.0.0.253:8080
secret_key = testing
signature_v2 = True 

But this did not help:

$ s3cmd ls
ERROR: Error parsing xml: Malformed error XML returned from remote server..  ErrorXML: <html><h1>Unauthorized</h1><p>This server could not verify that you are authorized to access the document you requested.</p></html>
ERROR: S3 error: 401 (Unauthorized)

Is it possible to use s3cmd to interact with the Swift service at all and what steps did I miss?


Solution

  • Openstack-Swift, although an object-storage like s3, has a different API. If you just need a command line, you can try Python-Swiftclient. However if you need a S3 like API, you need to configure the swift3, the middleware, which doesn't comes with Swift by default only after version 2.18.0. For earlier version you should install the middleware.