附录 F. 在一个独立的机器上安装 Websocket 代理
websocket 代理允许用户通过 noVNC 和 SPICE HTML5 控制台连接到虚拟机。noVNC 客户端使用 websockets 传递 VNC 数据。但是,QEMU 中的 VNC 服务器并不支持 websocket,因此,需要在客户端和 VNC 服务器间使用一个 websocket 代理。这个代理可以运行在任何可以访问网络的机器上(包括 Manager 所在的机器)。
因为安全和性能的原因,用户可能会需要在一台独立的机器上配置 websocket 代理。
注意
对 SPICE HTML5 的支持现在还是一个技术预览(Technology Preview )。技术预览将不被 Red Hat Subscription Service Level Agreements(SLAs)所完全支持,也不能保证它的所有功能都可以正常运行。Technology Preview 功能并不是为当前的生产环境所提供的,但用户可以通过这些功能来尽早接触将来会被使用的新产品技术,同时可以反馈您的意见来完善产品的开发。
本节介绍了如何在一个没有运行 Manager 的机器上安装并配置 websocket 代理的方法。如需了解如何在运行 Manager 的机器上配置 websocket 代理的信息,请参阅 第 3.3 节 “配置 Red Hat Virtualization Manager”。
过程 F.1. 在一台独立的机器上安装和配置 Websocket 代理
- 安装 websocket 代理:
yum install ovirt-engine-websocket-proxy
# yum install ovirt-engine-websocket-proxy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 运行
engine-setup
命令来配置 websocket 代理。engine-setup
# engine-setup
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意
如果 rhevm 软件包也被安装,则在被询问是否在这个主机上配置引擎时选择No
。 - 按 Enter 来允许
engine-setup
在机器上配置一个 websocket 代理服务器。Configure WebSocket Proxy on this machine? (Yes, No) [Yes]:
Configure WebSocket Proxy on this machine? (Yes, No) [Yes]:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 点 Enter 接受自动检测到的主机名(请注意,如果您使用的主机是虚拟机,自动检测到的主机名可能不正确);或输入一个不同的主机名后点 Enter:
Host fully qualified DNS name of this server [host.example.com]:
Host fully qualified DNS name of this server [host.example.com]:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 按 Enter 允许
engine-setup
配置防火墙并打开外部通讯所需的端口。如果不允许engine-setup
修改您的防火墙配置,则需要在以后手工打开所需的端口。Setup can automatically configure the firewall on this system. Note: automatic configuration of the firewall may overwrite current settings. Do you want Setup to configure the firewall? (Yes, No) [Yes]:
Setup can automatically configure the firewall on this system. Note: automatic configuration of the firewall may overwrite current settings. Do you want Setup to configure the firewall? (Yes, No) [Yes]:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 输入 Manager 所在机器的完全限定 DNS 名并点 Enter:
Host fully qualified DNS name of the engine server []: engine_host.example.com
Host fully qualified DNS name of the engine server []: engine_host.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 按 Enter 允许
engine-setup
在 Manager 的机器上执行操作,或按 2 来手工执行这些任务。Setup will need to do some actions on the remote engine server. Either automatically, using ssh as root to access it, or you will be prompted to manually perform each such action. Please choose one of the following: 1 - Access remote engine server using ssh as root 2 - Perform each action manually, use files to copy content around (1, 2) [1]:
Setup will need to do some actions on the remote engine server. Either automatically, using ssh as root to access it, or you will be prompted to manually perform each such action. Please choose one of the following: 1 - Access remote engine server using ssh as root 2 - Perform each action manually, use files to copy content around (1, 2) [1]:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 按 Enter 接受默认的 SSH 端口号,或输入 Manager 机器的端口号。
ssh port on remote engine server [22]:
ssh port on remote engine server [22]:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 输入登录到 Manager 机器的 root 密码并按 Enter。
root password on remote engine server engine_host.example.com:
root password on remote engine server engine_host.example.com:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- 选择是否复查 iptables 规则。
Generated iptables rules are different from current ones. Do you want to review them? (Yes, No) [No]:
Generated iptables rules are different from current ones. Do you want to review them? (Yes, No) [No]:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 按 Enter 确认配置。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如何配置 Manager 机器来使用设置的 websocket 代理的信息会被显示。Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 登录到 Manager 的机器,运行以下命令:
engine-config -s WebSocketProxy=host.example.com:6100 systemctl restart ovirt-engine.service
# engine-config -s WebSocketProxy=host.example.com:6100 # systemctl restart ovirt-engine.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow