openstack-swift - Swift TempAuth 在 HEAD 帐户时返回 404

标签 openstack-swift

我是 Swift 的新手,但正试图将它安装在我的 CentOS 6.5 VM 上。我已经做了

  1. 安装最新的 Swift 版本 (1.12.0) 和 python-swiftclient (2.0.2) 及其依赖项
  2. /svr/node/d1 准备和安装我的驱动器(格式为 xfs 的独立设备)
  3. 创建环并将设备添加到环(帐户、容器、对象)
  4. 构建环,为每个环生成一个 .ring.gz 文件。将它们放在/etc/swift 中
  5. 为代理配置hash_path_prefix
  6. 设置 TempAuth 并添加新用户 'myaccount:me',密码为 'pa'
  7. 启动代理和帐户。

我希望能成功

swift -A http://localhost:8080/auth/v1.0 -U myaccount:me -K pa stat

但是命令告诉我“找不到帐户”。为了查看详细信息,我做了

swift --debug -v -A http://localhost:8080/auth/v1.0 -U myaccount:me -K pa stat

输出是

INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): localhost
DEBUG:requests.packages.urllib3.connectionpool:"GET /auth/v1.0 HTTP/1.1" 200 0
DEBUG:swiftclient:REQ: curl -i http://localhost:8080/auth/v1.0 -X GET
DEBUG:swiftclient:RESP STATUS: 200 OK
DEBUG:swiftclient:RESP HEADERS: [('content-length', '0'), ('x-trans-id', 'tx88b6b6b71ec14c3393248-00530de039'), ('x-auth-token', 'AUTH_tkdc7e842046e9469da324f2ec82c80a92'), ('x-storage-token', 'AUTH_tkdc7e842046e9469da324f2ec82c80a92'), ('date', 'Wed, 26 Feb 2014 12:38:17 GMT'), ('x-storage-url', 'http://localhost:8080/v1/AUTH_myaccount'), ('content-type', 'text/html; charset=UTF-8')]
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): localhost
DEBUG:requests.packages.urllib3.connectionpool:"HEAD /v1/AUTH_myaccount HTTP/1.1" 404 0
INFO:swiftclient:REQ: curl -i http://localhost:8080/v1/AUTH_myaccount -I -H "X-Auth-Token: AUTH_tkdc7e842046e9469da324f2ec82c80a92"
INFO:swiftclient:RESP STATUS: 404 Not Found
INFO:swiftclient:RESP HEADERS: [('date', 'Wed, 26 Feb 2014 12:38:17 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('x-trans-id', 'tx553c40e63c69470e9d146-00530de039')]
ERROR:swiftclient:Account HEAD failed: http://localhost:8080:8080/v1/AUTH_myaccount 404 Not Found
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1192, in _retry
    rv = func(self.url, self.token, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 469, in head_account
    http_response_content=body)
ClientException: Account HEAD failed: http://localhost:8080:8080/v1/AUTH_myaccount 404 Not Found
Account not found

最佳答案

我想通了:在 proxy-server.conf 中,添加这两行

allow_account_management = true
account_autocreate = true

关于openstack-swift - Swift TempAuth 在 HEAD 帐户时返回 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22042212/

相关文章:

java - OpenStack Swift 分段上传 jclouds

java - OpenStack-KeyStone 与 Android 项目的连接

ibm-cloud - Bluemix 对象存储服务中对象的公共(public) URL

OpenStack Swift TempAuth 身份验证产品使用

python - 使用口是心非上传到 Swift 伪文件夹

linux - 从不受限用户运行时如何在文件上保留 SELinux 上下文

java - 无法在 JOSS-openstack 中生成带有过期时间的临时 GET url

python - OpenStack Swift + Keystone : Unable to determine tenancy

java - 使用 Joss 使用 Swift 进行身份验证

java - 如何在 OpenStack Object Storage(Swift) 中上传照片和其他文件