2.2. 在 Red Hat Enterprise Virtualization Hypervisor 中配置自承载引擎

当使用 Hypervisor ISO 安装了 Red Hat Enterprise Virtualization Hypervisor 后,可以通过 Hosted Engine 界面设置自承载引擎(self-hosted engine)。当前,Red Hat Enterprise Virtualization Hypervisor 版本 7 支持自承载引擎。

先决条件

  • 已经配置了全新安装的 Red Hat Enterprise Virtualization Hypervisor(RHEV-H)。
  • 为自承载引擎环境设置了存储系统。如需了解更多与存储相关的信息,请参阅 Red Hat Enterprise Virtualization 管理指南 中的 存储。存储共享最少需要 60 GB。
  • 设置了 Manager 和 Hypervisor 的完全限定域名(FQDN)。DNS 中需要有它的正向和反向查询记录。

    注意

    如果只是为了对系统进行评估,可以使用 /etc/hosts 文件实现域名解析功能。
  • 通过安全界面启用了 SSH 密码验证功能。
  • 具有 Manager 虚拟机操作系统的安装介质。我们推荐使用 RHEV-M Virtual Appliance 进行安装。这需要 /tmp 目录最少有 60 GB 的存储空间,Appliance 需要可以通过 HTTP 从 hypervisor 进行访问。RHEV-M Virtual Appliance 可以通过 Customer Portal, Download the RHEV-M Appliance 下载。

过程 2.1. 在 RHEV-H 上设置自承载引擎

以下示例展示了在 Red Hat Enterprise Virtualization Hypervisor 7 上配置自承载引擎的过程。
  1. Deploy Hosted Engine
  2. 指定 Red Hat Enterprise Virtualization Manager 虚拟机的安装方法。如果使用 RHEV-M Virtual Appliance 进行安装,输入 appliance 的 URL,如 http://file.domain.com/rhevm-appliance.ova。这是推荐的安装方法。点 Deploy,再点 Close
    或者,如果使用 PXE 进行安装,选择 PXE Boot Engine VM
  3. OK 启动 hosted-engine 部署脚本。点 Enter 开始进行安装。
  4. 配置存储

    选择使用的存储类型。
    During customization use CTRL-D to abort.
    Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs3, nfs4)[nfs3]:
    • 对于 NFS 存储类型,使用 FQDN 或 IP 地址指定它的完整地址,以及共享存储域的路径名。
      Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/nfs
    • 对于 iSCSI,指定 iSCSI 门户 IP 地址、端口、用户名和密码,并从检测到的列表中选择一个目标名。在部署的过程中只能选项一个 iSCSI 目标:
      Please specify the iSCSI portal IP address:           
      Please specify the iSCSI portal port [3260]:           
      Please specify the iSCSI portal user:           
      Please specify the iSCSI portal password:
      Please specify the target name (auto-detected values) [default]:
    • 对于 Gluster 存储类型,使用 FQDN 或 IP 地址指定它的完整地址,以及共享存储域的路径名。

      重要

      当前只支持 3 个 Gluster 存储副本(replica)。请确认已进行了以下配置:
      • 在所有 3 个 Gluster 服务器的 /etc/glusterfs/glusterd.vol 文件中,把 rpc-auth-allow-insecure 设置为 on
        option rpc-auth-allow-insecure on
      • 对卷进行以下配置:
        gluster volume set volume cluster.quorum-type auto
        gluster volume set volume network.ping-timeout 10
        gluster volume set volume auth.allow \*
        gluster volume set volume group virt
        gluster volume set volume storage.owner-uid 36
        gluster volume set volume storage.owner-gid 36
        gluster volume set volume server.allow-insecure on
      Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/gluster_volume
    • 对于光纤通道设备,主机的总线适配器需要被配置和连接,hosted-engine 脚本会自动检测到有效的 LUN。LUN 不能包括任何额外的数据。
      The following luns have been found on the requested target:
      [1]     3514f0c5447600351       30GiB   XtremIO XtremApp
                              status: used, paths: 2 active
                
      [2]     3514f0c5447600352       30GiB   XtremIO XtremApp
                              status: used, paths: 2 active
      
      Please select the destination LUN (1, 2) [1]:
    选择环境中使用的存储域和存储数据中心名。
    [ INFO  ] Installing on first host
    Please provide storage domain name. [hosted_storage]: 
    Local storage datacenter name is an internal name and currently will not be shown in engine's admin UI.Please enter local datacenter name [hosted_datacenter]:
  5. 配置网络

    这个脚本会检测可以被用来作为环境的管理网桥的网卡(NIC),然后会检查防火墙的配置,并为控制台(SPICE 或 VNC)访问修改防火墙的配置。

    注意

    当前,还不支持绑定的网络接口以及 vlan-tagged 网络接口。如果需要使用它们,请参阅 https://access.redhat.com/solutions/1417783
    Please indicate a nic to set rhevm bridge on: (eth1, eth0) [eth1]:
    iptables was detected on your computer, do you wish setup to configure it? (Yes, No)[Yes]: Yes
    Please indicate a pingable gateway IP address [X.X.X.X]:
  6. 配置虚拟机

    这个脚本会把一个虚拟机配置为 Red Hat Enterprise Virtualization Manager。

    注意

    如需手工安装 Manager 虚拟机,请参阅 附录 A, 手工安装 Manager 的操作系统。使用 appliance,可以简化安装过程,而使用手工安装的方法,可以对安装过程进行完全的控制。
    [ INFO ] Checking OVF archive content (could take a few minutes depending on archive size)
    [ INFO ] Checking OVF XML content (could take a few minutes depending on archive size)
             Would you like to use cloud-init to customize the appliance on the first boot (Yes, No)[Yes]?
             Would you like to generate on-fly a cloud-init no-cloud ISO image
             or do you have an existing one(Generate, Existing)[Generate]? Generate
             Please provide the FQDN you would like to use for the engine appliance.
             Note: This will be the FQDN of the engine VM you are now going to launch.
             It should not point to the base host or to any other existing machine.
             Engine VM FQDN: (leave it empty to skip): manager.example.com
             Automatically execute engine-setup on the engine appliance on first boot (Yes, No)[Yes]? Yes
             Automatically restart the engine VM as a monitored service after engine-setup (Yes, No)[Yes]? Yes
             Please provide the domain name you would like to use for the engine appliance.
             Engine VM domain: [example.com]
             Enter root password that will be used for the engine appliance (leave it empty to skip): p@ssw0rd
             Confirm appliance root password: p@ssw0rd
             How should the engine VM network be configured (DHCP, Static)[DHCP]? Static
             Please enter the IP address to be used for the engine VM: 192.168.x.x
    [ INFO ] The engine VM will be configured to use 192.168.x.x/24
             Please provide a comma-separated list (max3) of IP addresses of domain name servers for the engine VM
             Engine VM DNS (leave it empty to skip):
             Add lines for the appliance itself and for this host to /etc/hosts on the engine VM?
             Note: ensuring that this host could resolve the engine VM hostname is still up to you (Yes, No)[No] Yes
             Please specify an alias for the Hosted Engine image [hosted_engine]:
             The following CPU types are supported by this host:
                    - model_Penryn: Intel Penryn Family
                    - model_Conroe: Intel Conroe Family
             Please specify the CPU type to be used by the VM [model_Penryn]:
             Please specify the number of virtual CPUs for the VM [Defaults to appliance OVF value: 4]: 
             You may specify a MAC address for the VM or accept a randomly generated default [00:16:3e:77:b2:a4]: 
             Please specify the console type you would like to use to connect to the VM (vnc, spice) [vnc]: vnc
  7. 配置自承载引擎

    指定 hypervisor 在 Red Hat Enterprise Virtualization 环境中使用的名称,以及 admin@internal 用户用来访问管理门户( Administration Portal)的密码。为 Manager 虚拟机指定 FQDN。
    Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]:
    Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: p@ssw0rd
    Confirm 'admin@internal' user password: p@ssw0rd
    Please provide the name of the SMTP server through which we will send notifications [localhost]: 
    Please provide the TCP port number of the SMTP server [25]: 
    Please provide the email address from which notifications will be sent [root@localhost]: 
    Please provide a comma-separated list of email addresses which will get notifications [root@localhost]:
  8. 配置预览

    在实际进行配置前,hosted-engine 脚本会显示已输入的信息,并提示您确认这些信息。
  9. 配置 Manager 虚拟机

    这个脚本将创建 Manager 虚拟机,启动 ovirt-engine 和高可用性服务,并把 hypervisor 主机和共享存储域连接到 Manager 虚拟机。
    You can now connect to the VM with the following command:
    	/usr/bin/remote-viewer vnc://localhost:5900
    Use temporary password "3042QHpX" to connect to vnc console.
    Please note that in order to use remote-viewer you need to be able to run graphical applications.
    This means that if you are using ssh you have to supply the -Y flag (enables trusted X11 forwarding).
    Otherwise you can run the command from a terminal in your preferred desktop environment.
    If you cannot run graphical applications you can connect to the graphic console from another host or connect to the serial console using the following command:
    socat UNIX-CONNECT:/var/run/ovirt-vmconsole-console/fabbea5a-1989-411f-8ed7-7abe0917fc66.sock,user=ovirt-vmconsole STDIO,raw,echo=0,escape=1
    
    If you need to reboot the VM you will need to start it manually using the command:
    hosted-engine --vm-start
    You can then set a temporary password using the command:
    hosted-engine --add-console-password
    [ INFO ] Running engine-setup on the appliance
    ...
    [ INFO ] Engine-setup successfully completed
    [ INFO ] Engine is still unreachable
    [ INFO ] Engine is still unreachable, waiting...
    [ INFO ] Engine replied: DB Up!Welcome to Health Status!
    [ INFO ] Connecting to the Engine
             Enter the name of the cluster to which you want to add the host (Default) [Default]:
    [ INFO  ] Waiting for the host to become operational in the engine. This may take several minutes... [ INFO  ] Still waiting for VDSM host to become operational...
    [ INFO  ] The VDSM Host is now operational      
    [ INFO  ] Shutting down the engine VM
    [ INFO  ] Enabling and starting HA services
    [ INFO  ] Saving hosted-engine conifguration on the shared storage domain
              Hosted Engine successfully set up
    [ INFO  ] Stage: Clean up
    [ INFO  ] Generating answer file '/var/lib/ovirt-hosted-engine-setup/answers/answers-2015xx.conf'
    [ INFO  ] Generating answer file '/etc/ovirt-hosted-engine/answers.conf'
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
    
    [screen is terminating]
    Hit <Return> to return to the TUI
在第一个主机被配置后,Red Hat Enterprise Virtualization Manager 的名称和状态会出现在 Hosted Engine 界面中(这个过程可能会需要几分钟的时间)。使用 <Start additional host setup> 继续配置其它主机。

注意

默认情况下,SSH 密码验证不会在 RHEV-M Virtual Appliance 中启动,您可以通过 SPICE 或 VNC 控制台访问 Red Hat Enterprise Virtualization Manager 虚拟机来启用 SSH 密码。确认 sshd 服务正在运行。编辑 /etc/ssh/sshd_config,把以下两个选项设置为 yes
  • PasswordAuthentication
  • PermitRootLogin
重启 sshd 服务来使所做的修改生效。