2017-06-05 59 views
0

使用流浪安裝devstack。在安裝配置之前將HOST_IP設置爲127.0.0.1。完成安裝後,它告訴使用這些信息來訪問Web UI:如何從本地IP 127.0.0.1訪問流浪服務?

========================= 
DevStack Component Timing 
========================= 
Total runtime 3523 

run_process  113 
test_with_retry 7 
pip_install  647 
wait_for_service 51 
yum_install  338 
git_timed  853 
========================= 



This is your host IP address: 127.0.0.1 
This is your host IPv6 address: ::1 
Horizon is now available at http://127.0.0.1/dashboard 
Keystone is serving at http://127.0.0.1/identity/ 
The default users are: admin and demo 
The password: secret 
Services are running under systemd unit files. 
For more information see: 
https://docs.openstack.org/developer/devstack/systemd.html 

我設置private_ip在Vagrantfile與192.168.33.11,我想這種方式來訪問Web UI:

http://192.168.33.11/dashboard

但不起作用。因此,我測試中使用curl在流浪可以確認的東西:

[[email protected] devstack]$ curl -I http://127.0.0.1/dashboard 
HTTP/1.1 302 Found 
Date: Mon, 05 Jun 2017 10:38:37 GMT 
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 
Vary: Accept-Language,Cookie 
X-Frame-Options: SAMEORIGIN 
Content-Language: en 
Location: http://127.0.0.1/dashboard/auth/login/?next=/dashboard/ 
Content-Type: text/html; charset=utf-8 

如何現在訪問儀表板?

回答

1

這不起作用,因爲devstack運行在你的VM上127.0.0.1。

你可以改變從配置文件中的HOST_IP變量(下localrc部分 - 見https://docs.openstack.org/developer/devstack/configuration.html),並使用從Vagrantfile

HOST_IP=192.168.33.11 
SERVICE_HOST=$HOST_IP 
+0

設置謝謝你的靜態IP地址。但我所做的是爲我工作。我可以從外部主機訪問瀏覽器中的服務。 –

+0

確定它可以,但它有點繁瑣而且不直接,如果你將這個盒子傳遞給你的團隊中的某個人,我想他願意使用基本的'vagrant up',所以無論你是從VM還是你設置IP讓它監聽'0.0.0.0',以便綁定到所有網絡接口 –

0

這樣工作的:

$ ssh -L 8080:localhost:80 [email protected] 

從瀏覽器:

http://localhost:8080/dashboard


參考

$ man ssh 
-L [bind_address:]port:host:hostport 
     Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. This works by allocating a socket to listen to 
     port on the local side, optionally bound to the specified bind_address. Whenever a connection is made to this port, the connection is forwarded over the secure channel, 
     and a connection is made to host port hostport from the remote machine. Port forwardings can also be specified in the configuration file. IPv6 addresses can be specified 
     by enclosing the address in square brackets. Only the superuser can forward privileged ports. By default, the local port is bound in accordance with the GatewayPorts set‐ 
     ting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of 「localhost」 indicates that the listening port be 
     bound for local use only, while an empty address or ‘*’ indicates that the port should be available from all interfaces.