2

我按照http://docs.openstack.org/developer/swift/development_saio.html上的说明在机器 1(Centos 6)上安装了 OpenStack Swift 服务。

我能够在同一环境中使用 curl 检索令牌。

curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing'http://machine-1IP:8099/auth/v1.0

* About to connect() to machine-1 ip port 8099 (#0)
*   Trying machine-1ip... connected
* Connected to machine-1 port 8099 (#0)
> GET /auth/v1.0 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: machine-1IP:8099
> Accept: */*
> X-Storage-User: test:tester
> X-Storage-Pass: testing
>
< HTTP/1.1 200 OK
< X-Storage-Url: http://machine-1IP:8099/v1/AUTH_test
< X-Auth-Token: AUTH_tk1dc541c4be23424a92477b13deaa2fac
< Content-Type: text/html; charset=UTF-8
< X-Storage-Token: AUTH_tk1dc541c4be23424a92477b13deaa2fac
< Content-Length: 0
< Date: Thu, 18 Jul 2013 11:45:34 GMT

如果我尝试从另一台机器(机器 2)访问它。我得到主机不可访问异常。我可以从 machine-2 ping machine-1。

curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing'http://machine-1IP:port/auth/v1.0

* Adding handle: conn: 0xa7b670
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0xa7b670) send_pipe: 1, recv_pipe: 0
* Could not resolve host: test
* Closing connection 0
curl: (6) Could not resolve host: test
* Adding handle: conn: 0xa7c1b0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 1 (0xa7c1b0) send_pipe: 1, recv_pipe: 0
* Could not resolve host: testing'
* Closing connection 1
curl: (6) Could not resolve host: testing'
* About to connect() to machine-1 IP port 8099 (#2)
*   Trying machine-1 IP...
* Adding handle: conn: 0xa7c1b0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 2 (0xa7c1b0) send_pipe: 1, recv_pipe: 0
* Host unreachable
* Failed connect to machine-1IP:8099; Host unreachable
* Closing connection 2
curl: (7) Failed connect to Machine-1 IP:8099; Host unreachable

请建议为什么无法从远程机器访问 Swift REST 服务?我错过了配置中的任何内容吗?

4

1 回答 1

0

主机不可达意味着机器 2 无法访问机器 1。它与 Openstack/Swift 无关。检查您的路由器设置和/etc/hosts.

* Could not resolve host: testing'
* Failed connect to machine-1IP:8099; Host unreachable
于 2015-09-14T06:03:12.483 回答