B.3. 将 Websocket 代理迁移到一个独立的机器

重要

websocket 代理和 noVNC 只是一个技术预览功能。技术预览功能不被红帽产品服务级别协议(SLA)支持,且可能无法完成。红帽不建议在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。如需更多信息,请参阅红帽技术预览功能支持范围

为了安全起见,websocket 代理可以在不运行 Red Hat Virtualization Manager 的单独机器上运行。将 websocket 代理从 Manager 机器迁移到单独的计算机涉及从 Manager 机器中删除 websocket 代理配置,然后在单独的机器上安装代理。

engine-cleanup 命令可用于从 Manager 机器中删除 websocket 代理:

从 Manager 机器中删除 Websocket 代理

  1. 在 Manager 计算机上,运行 engine-cleanup 删除所需的配置。

    # engine-cleanup
  2. 在要求删除所有组件时键入 No,然后按 Enter 键。

    Do you want to remove all components? (Yes, No) [Yes]: No
  3. 当被要求删除引擎时输入 No,然后按 Enter 键。

    Do you want to remove the engine? (Yes, No) [Yes]: No
  4. 当被要求删除 websocket 代理时,键入 Yes 并按 Enter

    Do you want to remove the WebSocket proxy? (Yes, No) [No]: Yes

    如果被要求删除任何其他组件,请选择 No

在独立的机器中安装 Websocket 代理

重要

websocket 代理和 noVNC 只是一个技术预览功能。技术预览功能不被红帽产品服务级别协议(SLA)支持,且可能无法完成。红帽不建议在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。如需更多信息,请参阅红帽技术预览功能支持范围

websocket 代理允许用户通过 noVNC 控制台连接到虚拟机。noVNC 客户端使用 websocket 传递 VNC 数据。但是,QEMU 中的 VNC 服务器不提供 websocket 支持,因此必须在客户端和 VNC 服务器之间放置 websocket 代理。代理可以在任何可访问网络的机器中运行,包括 Manager 机器。

出于安全性和性能的原因,用户可能希望在单独的计算机上配置 websocket 代理。

步骤

  1. 安装 websocket 代理:

    # yum install ovirt-engine-websocket-proxy
  2. 运行 engine-setup 命令以配置 websocket 代理。

    # engine-setup
    注意

    如果也安装了 rhvm 软件包,则在要求在此主机上配置管理器(Engine)时,请选择 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 机器的 FQDN,然后按 Enter 键。

    Host fully qualified DNS name of the engine server []: manager.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. 输入 root 密码以登录到 Manager 计算机,然后按 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