curl:(6)无法解析主机; 401 Openstack Swift未经授权(SAIO)

时间:2016-03-25 06:17:08

标签: openstack-swift

我正在尝试通过链接http://docs.openstack.org/developer/swift/development_saio.html在Ubuntu 12.04 VM上设置'Swift All In One'系统。
我在Win7 64位系统上使用VMware WorkStation 12 Pro并使用“仅主机”网络模式.VM IP地址为“192.168.137.200”。
当我在VM上运行命令

curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://192.168.137.200/auth/v1.0

效果很好。
但是当我在主机(Win7平台)上运行命令时,它失败并返回:

* Could not resolve host: test:tester'; Host not found
* Closing connection #0
curl: (6) Could not resolve host: test:tester'; Host not found
* Could not resolve host: testing'; Host not found
* Closing connection #0
curl: (6) Could not resolve host: testing'; Host not found
* About to connect() to 192.168.137.200 port 80 (#0)
*   Trying 192.168.137.200... connected
* Connected to 192.168.137.200 (192.168.137.200) port 80 (#0)
> GET /auth/v1.0 HTTP/1.1
> User-Agent: curl/7.20.1 (amd64-pc-win32) libcurl/7.20.1 OpenSSL/0.9.8n zlib/1.
2.3
> Host: 192.168.137.200
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Date: Fri, 25 Mar 2016 05:57:24 GMT
< Content-Length: 131
< Content-Type: text/html; charset=UTF-8
< Www-Authenticate: Swift realm="unknown"
< X-Trans-Id: tx081d67bec35b457bb4cb8-0056f4d343
< Vary: Accept-Encoding
<
<html><h1>Unauthorized</h1><p>This server could not verify that you are authoriz
ed to access the document you requested.</p></html>* Connection #0 to host 192.1
68.137.200 left intact
* Closing connection #0

然后我创建另一个Ubuntu 12.04 VM并尝试在第二个VM上运行上面的命令,它运行良好。

1 个答案:

答案 0 :(得分:0)

尝试使用X-Auth-User和X-Auth-Key标头。
https://swiftstack.com/docs/cookbooks/swift_usage/auth.html