novnc:出了点问题,连接已关闭

时间:2019-05-07 07:00:28

标签: python

我无法将vm与novnc连接起来。

我正在玩带有两个节点的openstack。现在,我创建了一个虚拟机,并希望将其与novnc连接。我使用命令nova --os-region-name=RegionOne get-vnc-console vm1 novnc获取VM1 novnc URL。我在Firefox上使用它。 但是它表明something went wrong,connection is closed

enter image description here

我使用"nova --os-region-name=RegionOne get-vnc-console vm1 novnc来获取虚拟机的novnc网址。

我想用noc连接我的vm,但是不能。 它显示something went wrong,connection is closed

enter image description here

2 个答案:

答案 0 :(得分:0)

使用命令vncserver从终端启动novnc。稍后,刷新浏览器。

答案 1 :(得分:0)

我遇到了同样的问题,并且解决了。

您也许可以在openstack控制器/var/log/nova/nova-novncproxy.log中找到关注消息

2020-11-13 03:22:36.127 1240 INFO nova.console.websocketproxy [-] WebSocket server settings:
2020-11-13 03:22:36.132 1240 INFO nova.console.websocketproxy [-]   - Listen on 0.0.0.0:6080
2020-11-13 03:22:36.132 1240 INFO nova.console.websocketproxy [-]   - Flash security policy server
2020-11-13 03:22:36.132 1240 INFO nova.console.websocketproxy [-]   - Web server (no directory listings). Web root: /usr/share/novnc
2020-11-13 03:22:36.132 1240 INFO nova.console.websocketproxy [-]   - No SSL/TLS support (no cert file)
2020-11-13 03:22:36.133 1240 INFO nova.console.websocketproxy [-]   - proxying from 0.0.0.0:6080 to None:None
2020-11-13 03:38:17.145 5022 INFO nova.console.websocketproxy [-] 10.0.0.77 - - [13/Nov/2020 03:38:17] code 404, message File not found
2020-11-13 03:38:17.366 5024 INFO nova.console.websocketproxy [-] 10.0.0.77 - - [13/Nov/2020 03:38:17] 10.0.0.77: Plain non-SSL (ws://) WebSocket connection
2020-11-13 03:38:17.368 5024 INFO nova.console.websocketproxy [-] 10.0.0.77 - - [13/Nov/2020 03:38:17] 10.0.0.77: Version hybi-13, base64: 'False'
2020-11-13 03:38:17.368 5024 INFO nova.console.websocketproxy [-] 10.0.0.77 - - [13/Nov/2020 03:38:17] 10.0.0.77: Path: '/?token=b7454700-a95a-4596-b6a4-b51db45b1769'
2020-11-13 03:38:17.678 5024 INFO nova.console.websocketproxy [req-67099c31-6b34-4a3c-9f88-45a1ca30ad41 - - - - -]   3: connect info: ConsoleAuthToken(access_url_base='http://10.0.0.10:6080/vnc_auto.html',console_type='novnc',created_at=2020-11-13T03:37:50Z,host='comp1.ap-southeast-1.compute.internal',id=5,instance_uuid=3f2d9390-06c9-47b5-aa26-7f6a0836b1f6,internal_access_path=None,port=5900,token='***',updated_at=None)
2020-11-13 03:38:17.679 5024 INFO nova.console.websocketproxy [req-67099c31-6b34-4a3c-9f88-45a1ca30ad41 - - - - -]   3: connecting to: comp1.ap-southeast-1.compute.internal:5900
2020-11-13 03:38:17.686 5024 INFO nova.console.websocketproxy [req-67099c31-6b34-4a3c-9f88-45a1ca30ad41 - - - - -] handler exception: [Errno -2] Name or service not known
2020-11-13 03:39:11.898 5023 INFO nova.console.websocketproxy [-] handler exception: [Errno 110] Connection timed out

原因:未在/ etc / hosts中写入 comp1.ap-southeast-1.compute.internal

解决:在主机中添加别名

  3: connect info: ConsoleAuthToken(access_url_base='http://10.0.0.10:6080/vnc_auto.html'
  3: connecting to: comp1.ap-southeast-1.compute.internal:5900
 handler exception: [Errno -2] Name or service not known

顺便说一句,我不明白为什么vncproxy突然尝试通过IP地址中的主机名进行连接。 :p