2013-07-18 66 views
1

我已按照http://docs.openstack.org/developer/swift/development_saio.html上的說明在機器1(Centos 6)上安裝了OpenStack Swift服務。無法從遠程機器訪問Swift REST服務

我能夠在相同環境中使用curl檢索標記。

捲曲-v -H 'X-存儲的用戶:測試:測試儀' -H 'X-存儲通:測試' 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。

捲曲-v -H 'X-存儲的用戶:測試:測試儀' -H 'X-存儲通:測試' 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 

請說明爲什麼斯威夫特REST服務無法從遠程訪問機?我錯過了配置中的任何東西嗎?

+0

您的外部機器resolv.conf是否知道當請求指向「machine-1IP」時應映射到的IP地址 – koolhead17

回答

0

主機不可達意味着機2無法訪問到機器1.它沒有涉及到的OpenStack /斯威夫特。檢查你的路由器設置和/etc/hosts

* Could not resolve host: testing' 
* Failed connect to machine-1IP:8099; Host unreachable