openstack虚拟机部署之后无法访问虚拟机的控制台

openstack虚拟机部署之后无法访问虚拟机的控制台,错误如下:

2023-07-17 17:48:22.115 7512 INFO nova.console.websocketproxy [-] In exit
2023-07-17 17:48:22.115 7512 INFO nova.console.websocketproxy [-] Terminating child 9332
2023-07-17 17:48:22.139 9332 INFO nova.console.websocketproxy [-] In exit
2023-07-17 17:48:23.892 10510 INFO nova.console.websocketproxy [-] WebSocket server settings:
2023-07-17 17:48:23.892 10510 INFO nova.console.websocketproxy [-] - Listen on 0.0.0.0:6080
2023-07-17 17:48:23.892 10510 INFO nova.console.websocketproxy [-] - Flash security policy server
2023-07-17 17:48:23.893 10510 INFO nova.console.websocketproxy [-] - Web server (no directory listings). Web root: /usr/share/novnc
2023-07-17 17:48:23.893 10510 INFO nova.console.websocketproxy [-] - No SSL/TLS support (no cert file)
2023-07-17 17:48:23.893 10510 INFO nova.console.websocketproxy [-] - proxying from 0.0.0.0:6080 to None:None
2023-07-17 17:48:46.269 10798 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [17/Jul/2023 17:48:46] code 400, message Client must support ‘binary’ or ‘base64’ protocol
2023-07-17 17:49:04.609 10993 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [17/Jul/2023 17:49:04] code 400, message Client must support ‘binary’ or ‘base64’ protocol
2023-07-17 17:55:35.506 12630 INFO nova.console.websocketproxy [-] 172.16.10.11 - - [17/Jul/2023 17:55:35] code 400, message Client must support ‘binary’ or ‘base64’ protocol
2023-07-17 17:56:01.033 12853 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [17/Jul/2023 17:56:01] code 400, message Client must support ‘binary’ or ‘base64’ protocol

2023-07-18 10:35:03.345 11833 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [18/Jul/2023 10:35:03] 172.16.10.87: Plain non-SSL (ws://) WebSocket connection
2023-07-18 10:35:03.345 11833 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [18/Jul/2023 10:35:03] 172.16.10.87: Version hybi-13, base64: ‘False’
2023-07-18 10:35:03.346 11833 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [18/Jul/2023 10:35:03] 172.16.10.87: Path: ‘/?token=232d99f1-97fd-4922-9e56-441bdace05af’
2023-07-18 10:35:03.553 11833 INFO nova.console.websocketproxy [req-cfafe07c-56f3-4146-8cc8-74d02f52601c - - - - -] 2: 连接信息:ConsoleAuthToken(access_url_base=‘http://172.16.10.12:6080/vnc_auto.html’,console_type=‘novnc’,created_at=2023-07-18T02:35:01Z,host=‘nova01.localdomain’,id=39,instance_uuid=7d7f62f9-71ae-4567-9403-2f3466a4e5ec,internal_access_path=None,port=5901,token=‘***’,updated_at=None)
2023-07-18 10:35:03.553 11833 INFO nova.console.websocketproxy [req-cfafe07c-56f3-4146-8cc8-74d02f52601c - - - - -] 2: 连接到:nova01.localdomain:5901
2023-07-18 10:35:08.605 11833 INFO nova.console.websocketproxy [req-cfafe07c-56f3-4146-8cc8-74d02f52601c - - - - -] handler exception: [Errno 111] ECONNREFUSE


解决方法:

vim /usr/share/novnc/core/websock.js

找到下面这行:

this.attach(new WebSocket(uri, protocols));

大概在231行左右,修改为下面内容:

this.attach(new WebSocket(uri, ['binary', 'base64']));

有些版本内容是下面这行:

this._websocket = new WebSocket(uri, protocols);

修改为下面内容:

this._websocket = new WebSocket(uri, ['binary', 'base64']); // protocols);

重启对应的服务:

systemctl restart openstack-nova-novncproxy

或者

systemctl restart openstack-nova-conductor.service openstack-nova-novncproxy.service openstack-nova-scheduler.service

很重要的一点注意 控制节点 和 计算节点 的hostname,以及hosts文件内容;比如上面的错误可以通过追加计算节点IP映射关系解决:

172.16.10.13 	nova01
172.16.10.13 	nova01.localdomain

你可能感兴趣的:(日常错误,openstack)