Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

附录 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 代理

  1. 安装 websocket 代理:
    # yum install ovirt-engine-websocket-proxy
  2. 运行 engine-setup 命令来配置 websocket 代理。
    # engine-setup

    注意

    如果 rhevm 软件包也被安装,则在被询问是否在这个主机上配置引擎时选择 No
  3. Enter 来允许 engine-setup 在机器上配置一个 websocket 代理服务器。
    Configure WebSocket Proxy on this machine? (Yes, No) [Yes]:
  4. Enter 接受自动检测到的主机名(请注意,如果您使用的主机是虚拟机,自动检测到的主机名可能不正确);或输入一个不同的主机名后点 Enter
    Host fully qualified DNS name of this server [host.example.com]:
  5. 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]:
  6. 输入 Manager 所在机器的完全限定 DNS 名并点 Enter
    Host fully qualified DNS name of the engine server []: engine_host.example.com
  7. 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]:
    1. Enter 接受默认的 SSH 端口号,或输入 Manager 机器的端口号。
      ssh port on remote engine server [22]:
      
    2. 输入登录到 Manager 机器的 root 密码并按 Enter
      root password on remote engine server engine_host.example.com:
      
  8. 选择是否复查 iptables 规则。
    Generated iptables rules are different from current ones.
    Do you want to review them? (Yes, No) [No]:
  9. Enter 确认配置。
    --== CONFIGURATION PREVIEW ==--
             
    Firewall manager                        : iptables
    Update Firewall                         : True
    Host FQDN                               : host.example.com
    Configure WebSocket Proxy               : True
    Engine Host FQDN                        : engine_host.example.com
             
    Please confirm installation settings (OK, Cancel) [OK]:
    如何配置 Manager 机器来使用设置的 websocket 代理的信息会被显示。
    Manual actions are required on the engine host
    in order to enroll certs for this host and configure the engine about it.
             
    Please execute this command on the engine host: 
       engine-config -s WebSocketProxy=host.example.com:6100
    and than restart the engine service to make it effective
  10. 登录到 Manager 的机器,运行以下命令:
    # engine-config -s WebSocketProxy=host.example.com:6100
    # systemctl restart ovirt-engine.service