自承载引擎指南

Red Hat Enterprise Virtualization 3.6

安装和迁移 Red Hat Enterprise Virtualization 自承载(Self-Hosted)引擎

Red Hat Enterprise Virtualization Documentation Team

Red Hat Customer Content Services

摘要

关于自承载引擎的详细指南

第 1 章 介绍

自承载(self-hosted)引擎就是一个虚拟化环境,它的引擎(Manager)运行在由这个引擎管理的一台主机的虚拟机上。虚拟机会作为主机配置的一部分被创建,在主机配置的过程中会并行安装并配置引擎。使用自承载引擎的主要好处是,部署 Red Hat Enterprise Virtualization 时对硬件的要求更少,这是因为引擎本身在一个虚拟机上运行,而不再需要在一个物理硬件上运行。另外,引擎会被配置为高可用性。当运行 Manager 的虚拟机处于维护模式时,或出现故障,虚拟机会被自动迁移到环境中的另外一个主机上运行。为了实现高可用性功能,最少需要两个自承载引擎主机。
您可以使用 Red Hat Enterprise Virtualization Hypervisors 或 Red Hat Enterprise Linux 主机作为自承载引擎主机。第 2 章 在 Red Hat Enterprise Virtualization Hypervisor 上部署自承载引擎第 3 章 在 Red Hat Enterprise Linux 主机上部署自承载引擎中介绍了相关内容。
您可以使用 RHEV-M Virtual Appliance 来自动设置 Manager 虚拟机,也可以手动安装并配置它。如需了解更多相关信息,请参阅 附录 B, 不同 Manager 虚拟机设置流程的比较

表 1.1. 支持部署自承载引擎的操作系统版本

系统类型
支持的版本
Red Hat Enterprise Linux 主机
7.2
Red Hat Enterprise Virtualization Hypervisor 主机
7.2
HostedEngine-VM (Manager)
6.7

第 2 章 在 Red Hat Enterprise Virtualization Hypervisor 上部署自承载引擎

2.1. 安装 Red Hat Enterprise Virtualization Hypervisor

首先安装一个 Red Hat Enterprise Virtualization Hypervisor 系统,然后才可以在这个系统上配置自承载引擎。请参阅安装指南中的 Installing the Red Hat Enterprise Virtualization Hypervisor 以获得更多相关信息。在 Red Hat Enterprise Virtualization Hypervisor 被安装后,需要先配置 Network 界面中的设置,然后再进行 Hosted Engine 界面的配置。

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 服务来使所做的修改生效。

第 3 章 在 Red Hat Enterprise Linux 主机上部署自承载引擎

3.1. 订阅所需的权利

注册系统并订阅所需的权利。

过程 3.1. 使用 Subscription Manager 订阅所需的权利(Entitlement)

  1. 在 Content Delivery Network 中注册您的系统,在出现提示时输入客户门户网站的用户名密码
    # subscription-manager register
  2. 找到 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池,并记录下它们的 ID。
    # subscription-manager list --available
  3. 使用在上一步所获得的权利池 ID 把 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 的权利附加到系统上。运行以下命令:
    # subscription-manager attach --pool=poolid
  4. 禁用所有存在的软件仓库:
    # subscription-manager repos --disable=*
  5. 启用所需的仓库:
    • Red Hat Enterprise Linux 6:

      重要

      对于 Red Hat Enterprise Linux 6,ovirt-hosted-engine-setup 软件包由 rhel-6-server-rhevm-3.6-rpms 仓库提供。如果您只有一个 Red Hat Enterprise Virtualization 环境,您将需要首先把权利附加到主机。在下载完 ovirt-hosted-engine-setup 软件包后,删除订阅,从而可以把它重新附加给作为 Manager 的虚拟机。如需了解如何删除一个产品订阅的信息,请参阅 https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/sub-cli.html
      # subscription-manager repos --enable=rhel-6-server-rpms
      # subscription-manager repos --enable=rhel-6-server-optional-rpms
      # subscription-manager repos --enable=rhel-6-server-supplementary-rpms	
      # subscription-manager repos --enable=rhel-6-server-rhev-mgmt-agent-rpms
      # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    • Red Hat Enterprise Linux 7:
      # subscription-manager repos --enable=rhel-7-server-rpms
      # subscription-manager repos --enable=rhel-7-server-rhev-mgmt-agent-rpms
  6. 确认当前安装的软件包已被升级到最新版本:
    # yum update

    注意

    如果与内核相关的软件包已被更新,则需要重启机器。

3.2. 安装自承载引擎软件包

过程 3.2. 安装自承载引擎

  1. 安装自承载引擎软件包
    # yum install ovirt-hosted-engine-setup
  2. 如果您选择使用 appliance 来安装 Manager 虚拟机,则需要安装 RHEV-M Virtual Appliance 软件包:
    # yum install rhevm-appliance
    您也可以使用 CD-ROM、磁盘或 PXE 安装 Manager 的操作系统。物理的 CD-ROM 驱动设备不被支持。
根据以下介绍的方法在 Red Hat Enterprise Linux 主机上部署和配置自承载引擎。

3.3. 配置基于 RHEL 的自承载引擎

hosted-engine 脚本可以帮助进行 hypervisor 和 Manager 虚拟机的配置。这个脚本会要求您回答一系列问题,然后根据您提供的信息对系统进行配置。
先决条件

请确认已经满足了以下先决条件:

  • 已经安装了一个全新的 Red Hat Enterprise Linux 7 系统,并在其中安装了 ovirt-hosted-engine-setup 软件包。
  • 为自承载引擎环境设置了存储系统。如需了解更多与存储相关的信息,请参阅 Red Hat Enterprise Virtualization 管理指南 中的 存储
  • 设置了 Manager 和 Hypervisor 的完全限定域名(FQDN)。DNS 中需要有它的正向和反向查询记录。
  • 需要具有为 Manger 安装操作系统所需的安装介质(CD-ROM、磁盘或 PXE)。推荐的方法是选择磁盘选项,并使用RHEV-M Virtual Appliance 安装 Manager。在安装 rhevm-appliance 软件包后,就可以使用 RHEV-M Virtual Appliance。如果选择使用 CD-ROM 选项,则需要使用一个 ISO 文件。物理的 CD-ROM 驱动设备不被支持。
  • 如果使用 RHEV-M Virtual Appliance 安装 Manager,/tmp 目录最少需要 60 GB。

过程 3.3. 配置基于 RHEL 的自承载引擎

  1. 初始化引擎

    运行 hosted-engine 脚本。推荐使用 screen 来运行这个脚本。这可以防止,在出现网络问题或终端被非正常终止时丢失当前运行的任务。screen 软件包包括在标准的 Red Hat Enterprise Linux 软件仓库中,安装这个软件包后就可以使用这个工具程序。使用 CTRL+D 键组合可以随时终止脚本。
    # yum install screen
    # screen hosted-engine --deploy

    注意

    当网络中断或超时时,可以运行 screen -d -r 来恢复当前运行的 hosted-engine
  2. 配置存储

    选择使用的存储类型。
    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]:
  3. 配置网络

    这个脚本会检测可以被用来作为环境的管理网桥的网卡(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]:
  4. 配置虚拟机

    注意

    如需手工安装 Manager 虚拟机,请参阅 附录 A, 手工安装 Manager 的操作系统。使用 appliance,可以简化安装过程,而使用手工安装的方法,可以对安装过程进行完全的控制。
    选择 disk 作为引导设备类型,脚本会自动检测到可用的 RHEV-M Appliances。指定内存的大小。
             Please specify the device to boot the VM from (cdrom, disk, pxe) [disk]: 
    [ INFO ] Detecting available oVirt engine appliances
             The following appliance have been found on your system:
                   [1] - The oVirt Engine Appliance image (OVA)
                   [2] - Directly select an OVA file
             Please select an appliance (1, 2) [1]:
    [ INFO ] Checking OVF archive content (could take a few minutes depending on archive size)
    	       Please specify the memory size of the appliance in MB (Defaults to OVF value: 16384):
    如果使用 cloud-init 对 Manager 虚拟机进行初始设置,则选 Yes。选择 Generate 来使用 cloud-init 进行配置,如设置 root 密码、配置网络、配置主机名、为 engine-setup 提供使用的应答文件、在引导时运行 engine-setup。另外,如果已有存在的 cloud-init 脚本,则可以选择 Existing 来使用这个脚本。指定 Manager 虚拟机的 FQDN。为 HostedEngine-VM 指定一个 MAC 地址,或使用随机推荐的地址。您可以在虚拟机安装操作系统前,使用这个 MAC 地址更新您的 DHCP 和 DNS 服务器。

    注意

    如需了解更多与 cloud-init 相关的信息,请参阅 https://cloudinit.readthedocs.org/en/latest/
    Would you like to use cloud-init to customize the appliance on the first boot (Yes, No)[Yes]? 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
    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
  5. 配置引擎

    指定在管理门户中标识 hypervisor 主机的名称,以及访问管理门户所使用的 admin@internal 用户的密码。提供 HostedEngine-VM 的 FQDN(在这里我们使用 Manager.example.com 作为 FQDN)。为 SMTP 服务器提供名称和 TCP 端口号、发送事件通知的电子邮件地址、以及需要接收事件通知的用户的电子邮件地址列表(以逗号分隔)。
    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]:
  6. 配置预览

    在实际进行配置前,hosted-engine 脚本会显示已输入的信息,并提示您确认这些信息。
  7. 配置 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
hosted-engine 部署脚本成功完成后,Red Hat Enterprise Virtualization Manager 就已经被配置完成,并在您的 hypervisor 服务器上运行。Manager 已经配置好了数据中心、集群、hypervisor 主机、Manager 虚拟机,以及 Manager 虚拟机专用的共享存储域。您可以使用 admin@internal 用户登录来继续进行 Manager 的配置,并添加其它资源。您需要创建另外一个数据域来提供常规的虚拟机数据。
把您的 Red Hat Enterprise Virtualization Manager 和一个目录服务相关联,从而可以向环境添加额外的用户。Red Hat Enterprise Virtualization 支持的目录服务包括 Red Hat Directory Server (RHDS)、IdM 和 Active Directory。您需要使用 engine-manage-domains 命令在环境中添加目录服务器。
ovirt-hosted-engine-setup 脚本同时也会把您在配置过程中提供的信息保存为一个应答文件,您可以使用它来进行系统恢复。如果没有使用 --generate-answer=<file> 参数指定应答文件,它会被默认存为 /etc/ovirt-hosted-engine/answers.conf

注意

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

第 4 章 迁移到一个基于 RHEL 的自承载环境

4.1. 迁移到自承载环境

当需要把一个标准 Red Hat Enterprise Virtualization 中存在的实例迁移到自承载环境中时,可以使用 hosted-engine 脚本来简化迁移的过程。这个脚本会要求用户输入一系列信息,并根据提供的信息对环境进行配置。在以下过程中,标准 Red Hat Enterprise Virtualization 环境中的 Manager 被称为 BareMetal-Manager。
迁移过程包括以下几个关键的步骤:
  • 运行 hosted-engine 脚本来配置主机作为自承载引擎的主机,并创建一个新的 Red Hat Enterprise Virtualization 虚拟机。
  • 使用 engine-backup 工具程序备份引擎数据库和配置文件,把备份数据复制到新的 Manager 虚拟机上,并使用带有 --mode=restore 选项的 engine-backup 命令恢复备份。运行 engine-setup 对 Manager 虚拟机进行配置。
  • 使用 hosted-engine 脚本进行设置。

先决条件

  • 准备一个安装了 ovirt-hosted-engine-setup 软件包的新 hypervisor 主机。请参阅 第 2 章 在 Red Hat Enterprise Virtualization Hypervisor 上部署自承载引擎 以获得相关的详细信息。主机需要是当前 Red Hat Enterprise Virtualization 环境支持的版本。

    注意

    如果选择使用一个已存在的主机,把它设置为维护模式,并把它移出当前的环境。请参阅 管理指南 中的 Removing a Host 以获得更详细的相关信息。
  • 获得和 BareMetal-Manager 使用的操作系统相同版本的安装介质。
  • 新的 Manager 的完全限定域名需要和原始 BareMetal-Manager 的完全限定域名相同。DNS 中需要有它的正向和反向查询记录。
  • 需要有访问和修改 BareMetal-Manager 的权限。

过程 4.1. 迁移到自承载环境

  1. 初始化引擎

    运行 hosted-engine 脚本。推荐使用 screen 来运行这个脚本,这可以防止,在出现网络问题或终端被非正常终止时丢失当前运行的任务。screen 软件包包括在标准的 Red Hat Enterprise Linux 软件仓库中,安装这个软件包后就可以使用这个工具程序。使用 CTRL+D 键组合可以随时终止脚本。
    # yum install screen
    # screen hosted-engine --deploy

    注意

    当网络中断或超时时,可以运行 screen -d -r 来恢复当前运行的 hosted-engine
  2. 配置存储

    选择使用的存储类型。
    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]:
  3. 配置网络

    这个脚本会检测可以被用来对环境进行管理的网卡(NIC),然后会检查防火墙的配置,并根据控制台(SPICE 或 VNC)访问 HostedEngine-VM 的需要来修改防火墙的配置。另外,提供一个可以被 ping 到的网络 IP 地址,ovirt-ha-agent 会使用它来决定 HostedEngine-VM 是否在正常运行。
    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]: 
    Please indicate a pingable gateway IP address [X.X.X.X]:
  4. 配置虚拟机

    脚本会创建一个虚拟机,并把它配置为一个 Red Hat Enterprise Virtualization Manager(在这里被称为 HostedEngine-VM)。指定引导设备、安装介质的路径名、CPU 类型、虚拟 CPU 的数量以及磁盘的大小。为 HostedEngine-VM 指定一个 MAC 地址,或使用系统自动创建的地址。在虚拟机安装操作系统前,可以使用这个 MAC 地址更新 DHCP 服务器。为 HostedEngine-VM 指定内存的大小,以及控制器连接类型。
    Please specify the device to boot the VM from (cdrom, disk, pxe) [cdrom]: 
    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 minimum requirement: 2]: 
    Please specify the disk size of the VM in GB [Defaults to minimum requirement: 25]: 
    You may specify a MAC address for the VM or accept a randomly generated default [00:16:3e:77:b2:a4]: 
    Please specify the memory size of the VM in MB [Defaults to minimum requirement: 4096]: 
    Please specify the console type you want to use to connect to the VM (vnc, spice) [vnc]:
  5. 配置引擎

    指定在 Red Hat Enterprise Virtualization 环境中标识 Host-HE1 的名称,以及访问管理门户所使用的 admin@internal 用户的密码。提供 HostedEngine-VM 的 FQDN(在这里我们使用 Manager.example.com 作为 FQDN)。最后,提供 SMTP 的名称和 TCP 端口号、发送事件通知的电子邮件地址、以及需要接收事件通知的用户的电子邮件地址列表(以逗号分隔)。

    重要

    引擎的 FQDN 必须和 BareMetal-Manager 在初始设置时提供的 FQDN 相同。
    Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]: Host-HE1
    Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: 
    Confirm 'admin@internal' user password: 
    Please provide the FQDN for the engine you want to use. This needs to match the FQDN that you will use for the engine installation within the VM: manager.example.com
    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]:
  6. 配置预览

    在实际进行配置前,hosted-engine 脚本会显示已输入的信息,并提示您确认这些信息。
    Bridge interface                   : eth1
    Engine FQDN                        : manager.example.com
    Bridge name                        : rhevm
    SSH daemon port                    : 22
    Firewall manager                   : iptables
    Gateway address                    : X.X.X.X
    Host name for web application      : Host-HE1
    Host ID                            : 1
    Image size GB                      : 25
    Storage connection                 : storage.example.com:/hosted_engine/nfs
    Console type                       : vnc
    Memory size MB                     : 4096
    MAC address                        : 00:16:3e:77:b2:a4
    Boot type                          : pxe
    Number of CPUs                     : 2
    CPU Type                           : model_Penryn
    
    Please confirm installation settings (Yes, No)[No]:
  7. 配置 HostedEngine-VM

    这个脚本会创建虚拟机 HostedEngine-VM,并提供和它进行连接的详情信息。您需要在 HostedEngine-VM 上安装一个操作系统后才能继续在 Host-HE1 上执行 hosted-engine 脚本。
    [ INFO  ] Stage: Transaction setup
    ...
    [ INFO  ] Creating VM
    You can now connect to the VM with the following command:
    	/usr/bin/remote-viewer vnc://localhost:5900
    Use temporary password "5379skAb" 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 console using the following command:
    virsh -c qemu+tls://Test/system console HostedEngine
    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
    The VM has been started.  Install the OS and shut down or reboot it.  To continue please make a selection:
             
              (1) Continue setup - VM installation is complete
              (2) Reboot the VM and restart installation
              (3) Abort setup
              (4) Destroy VM and abort setup
             
              (1, 2, 3, 4)[1]:
    运行以下命令使用 VNC 协议连接到虚拟机。使用自承载引擎主机的 FQDN 或 IP 地址替换其中的 FQDN。
    /usr/bin/remote-viewer vnc://FQDN:5900
  8. 安装虚拟机操作系统

    连接到 hosted-engine 脚本所创建的虚拟机(HostedEngine-VM),安装 Red Hat Enterprise Linux 6.7 操作系统。
  9. 同步主机和虚拟机

    返回到 Host-HE1,选择选项 1 来继续 hosted-engine 脚本:
    (1) Continue setup - VM installation is complete
  10. 安装 Manager

    连接到 HostedEngine-VM,订阅相关的 Red Hat Enterprise Virtualization Manager 仓库(repository)。详情请参阅安装指南中的 订阅所需的权利
    确认所有安装的软件包都是最新版本,并安装了 rhevm 软件包。
    # yum update
    # yum install rhevm
  11. 禁用 BareMetal-Manager

    连接到 BareMetal-Manager,停止引擎并禁止它在系统引导时运行。
    # service ovirt-engine stop
    # chkconfig ovirt-engine off

    注意

    推荐停止运行 BareMetal-Manager,这可以确保在系统备份被创建后,不会再对虚拟环境进行改变。另外,它还可以防止 BareMetal-Manager 和 HostedEngine-VM 同时管理存在的资源。
  12. 更新 DNS

    更新您的 DNS,从而使 Red Hat Enterprise Virtualization 环境的 FQDN 可以正确地解析 HostedEngine-VM 的 IP 地址,以及在 Host-HE1 上配置 hosted-engine 部署脚本所提供的 FQDN。在这里,FQDN 被设置为 manager.example.com,因为所提供引擎的 FQDN 和新设置引擎的 FQDN 必须相同。
  13. 为 BareMetal-Manager 创建一个备份

    连接到 BareMetal-Manager,运行 engine-backup 命令。使用 --mode=backup--file=FILE--log=LogFILE 参数来分别指定备份的模式、备份文件的名称以及日志文件的名称。
    # engine-backup --mode=backup --file=FILE --log=LogFILE
  14. 把备份文件复制到 HostedEngine-VM

    登录到 BareMetal-Manager,把备份文件复制到 HostedEngine-VM 上。在以下的例子中,[manager.example.com] 是 HostedEngine-VM 的 FQDN,/backup/ 是备份文件要被复制到的目录或路径。如果这些目录和路径还没有存在,您需要登录到 HostedEngine-VM 上后创建它们。
    # scp -p FILE LogFILE manager.example.com:/backup/
  15. 在 HostedEngine-VM 上恢复备份文件

    参阅 第 6.3 节 “恢复自承载引擎 Manager”。因为已在前面的步骤中进行了,所以请跳过恢复过程中的 Copying the Backup Files to the New Manager 一步。在运行 engine-setup 后返回这个过程。
  16. 把主机和 Manager 进行同步

    返回到 Host-HE1,选择选项 1 来继续 hosted-engine 脚本:
    (1) Continue setup - engine installation is complete
    [ INFO  ] Engine replied: DB Up!Welcome to Health Status!
    [ 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
              Please shutdown the VM allowing the system to launch it as a monitored service.
              The system will wait until the VM is down.
  17. 关闭 HostedEngine-VM

    关闭 HostedEngine-VM。
    # shutdown -h now
  18. 设置确认

    返回到 Host-HE1,确认它检测到 HostedEngine-VM 已经被关闭。
    [ INFO  ] Enabling and starting HA services
              Hosted Engine successfully set up
    [ INFO  ] Stage: Clean up
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
现在,Red Hat Enterprise Virtualization 引擎已被迁移到一个自承载引擎环境中。Manager 现在运行于 Host-HE1 主机中的一个虚拟机(HostedEngine-VM)上。HostedEngine-VM 被设置为高可用的,它会在需要时被迁移到其它主机上。

第 5 章 维护和升级资源

5.1. 维护基于 RHEL 的自承载引擎

维护模式使您可以在不影响高可用性代理的情况下启动、停止和修改引擎虚拟机;或在不影响引擎的情况下重启和修改环境中的主机。在版本 3.6 以前,除了通过管理门户把主机设置为维护模式外,还需要运行自承载引擎维护命令(hosted-engine --set-maintenance)。现在,当把主机设置为维护模式后,设置本地(local)维护的操作会被自动触发。全局(global)维护模式可以通过管理门户启动(在管理门户中的引擎虚拟机上点鼠标右键,选启用全局 HA 维护)。
维护模式分为 3 类:
  • global - 机器中的所有高可用代理都不会监测引擎虚拟机的状态。当要进行的设置或升级操作需要停止引擎时,您需要设置 global 维护模式。例如,升级 Red Hat Enterprise Virtualization 的版本;安装报表门户所需的 rhevm-dwhrhevm-reports 软件包。
  • local - 发出命令的主机上的高可用性代理不会监测引擎虚拟机的状态。当主机处于 local 维护模式时,它不会被用来运行虚拟机;如果把正在运行引擎虚拟机的主机设为这个模式,引擎会被迁移到另外一个主机上。当应用系统改变或更新主机时,我们推荐您把主机设为 local 维护模式。
  • none - 禁用维护模式,确保高可用性代理可以正常工作。

5.2. 升级基于 RHEL 的自承载引擎

把 Red Hat Enterprise Virtualization 引擎环境从版本 3.5 升级到 3.6。
这个升级的过程将升级两个主机(称为 Host A 和 Host B)以及 Manager 所在的虚拟机。在这里,Host B 是运行 Manager 所在虚拟机的主机。
我们推荐在把 Manager 所在的虚拟机进行升级,以及把集群的兼容版本升级到 3.6 前,把环境中的所有主机同时升级。这可以避免使用 3.5 版本的主机进入 Non Operational 状态。

过程 5.1. 升级自承载引擎

  1. 访问管理门户。选择 Host A,点维护把它设为维护模式。如果 Manager 所在的虚拟机运用于 Host A,这个虚拟机会被迁移到 Host B。
  2. 在 Host A 上启用新的仓库。
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
  3. 更新 Host A.
    # yum update
  4. 在 Host A 上重启 VDSM。
    # systemctl restart vdsmd
  5. 在 Host A 上重启 ovirt-ha-brokerovirt-ha-agent
    # systemctl restart ovirt-ha-broker
    # systemctl restart ovirt-ha-agent
  6. 访问管理门户。选择 Host A,点激活按钮激活它。
  7. 在 Host A 上禁用旧的仓库。
    # subscription-manager repos --disable=rhel-6-server-rhevm-3.5-rpms
  8. 当 Host A 的状态变为 Up 时,选 Host B,点维护把它设为维护模式。这将把运行 Manager 的虚拟机迁移到 Host A。
  9. 在 Host B 上启用新的仓库。
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
  10. 更新 Host B。
    # yum update
  11. 在 Host B 上重启 VDSM。
    # systemctl restart vdsmd
  12. 在 Host B 上重启 ovirt-ha-brokerovirt-ha-agent
    # systemctl restart ovirt-ha-broker
    # systemctl restart ovirt-ha-agent
  13. 访问管理门户。选择 Host B,点激活按钮激活它。
  14. 在 Host B 上禁用旧的仓库。
    # subscription-manager repos --disable=rhel-6-server-rhevm-3.5-rpms
  15. 登录到 Manager 虚拟机来升级 Red Hat Enterprise Virtualization Manager。
    1. 在 Red Hat Enterprise Virtualization Manager 所在的系统上订阅提供 Red Hat Enterprise Virtualization Manager 3.6 软件包的权利:
      # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    2. 更新基本操作系统,确保您使用最新版本的 engine-setup
      # yum update
    3. 运行 engine-setup 命令并根据提示升级 Red Hat Enterprise Virtualization Manager。
      # engine-setup
    4. 删除或禁用 Red Hat Enterprise Virtualization Manager 3.5 的频道,确保系统不再使用 Red Hat Enterprise Virtualization Manager 3.5 软件包:
      # subscription-manager repos --disable=rhel-6-server-rhevm-3.5-rpms
  16. 访问管理门户。
    1. 选择 Default 集群,点编辑打开编辑集群窗口。
    2. 兼容版本下拉菜单中选择 3.6。点确定保存所做的修改并关闭窗口。

5.3. 升级基于 RHEV-H-的自承载引擎环境

为了把基于 RHEV-H 的自承载引擎环境从 3.5 升级到 3.6,需要把底层的 Red Hat Enterpriser Hypervisor 升级到版本 7.1。这个过程和升级标准 Red Hat Enterpriser Hypervisor 的过程相同。如需了解更多信息,请参阅升级指南中的 Updating Red Hat Enterprise Virtualization Hypervisors

5.4. 在基于 RHEL 的自承载环境中升级额外的主机

我们推荐您对自承载环境中的所有主机同时进行升级,这可以避免使用较老版本的主机进入 Non Operational 状态。如果您的环境不允许这么做,则可根据以下介绍的方法对特定主机进行升级。

过程 5.2. 升级额外的主机

  1. 访问管理门户。选择主机,点维护按钮把它设为维护模式。这可以确保此主机不运行 Manager 虚拟机,hosted-engine 守护进程自动进入本地维护模式。
  2. 在主机上启用新的仓库
    # subscription-manager repos --enable=rhel-7-server-rhevm-3.6-rpms
  3. 更新主机。
    # yum update
  4. 在主机上重启 VDSM。
    # service vdsmd restart
  5. 在主机上重启 ovirt-ha-brokerovirt-ha-agent
    # service ovirt-ha-broker restart
    # service ovirt-ha-agent restart
  6. 访问管理门户。选择主机,点激活按钮激活它。
  7. 禁用主机上的旧仓库。
    # subscription-manager repos --disable=rhel-7-server-rhevm-3.6-rpms

5.5. 从自承载引擎环境中删除一个主机

如果需要从环境中删除一个自承载引擎主机,您需要把这个主机设置为维护模式,禁用 HA 服务,并把自承载引擎从配置文件中删除。

过程 5.3. 从自承载引擎环境中删除一个主机

  1. 在管理门户中,点主机资源标签页。选择主机并点维护把这个主机设置为本地维护模式。这会停止 ovirt-ha-agent 服务和 ovirt-ha-broker 服务。
  2. 登录到主机,禁用 HA 服务,并使这个服务不会在系统重启时被启动:
    • Red Hat Enterprise Linux 6:
      # chkconfig ovirt-ha-agent off
      # chkconfig ovirt-ha-broker off
    • Red Hat Enterprise Linux 7:
      # systemctl disable ovirt-ha-agent
      # systemctl disable ovirt-ha-broker
  3. 删除自承载引擎配置文件:
    • 基于 RHEL 的 hypervisor:
      # rm /etc/ovirt-hosted-engine/hosted-engine.conf
    • RHEV-H:
      # rm /etc/ovirt-hosted-engine/hosted-engine.conf
      # unpersist /etc/ovirt-hosted-engine/hosted-engine.conf
  4. 在管理门户中,选择相同的主机,点删除打开删除主机确认窗口。点确定

第 6 章 备份和恢复基于 RHEL 的自承载引擎环境

本节介绍了如何备份一个自承载引擎环境,并在一个全新安装的主机上恢复它的方法。在这里,被支持的备份方法是使用 engine-backup 进行备份,它只备份 Red Hat Enterprise Virtualization Manager 虚拟机,而不备份 Manager 虚拟机所在的主机。
备份和恢复自承载引擎环境包括以下几个关键操作:
  1. 备份原始的 Red Hat Enterprise Virtualization Manager 配置设置和数据库内容。
  2. 创建一个全新安装的 Red Hat Enterprise Linux 主机并运行 hosted-engine 部署脚本。
  3. 在新的 Manager 虚拟机上恢复 Red Hat Enterprise Virtualization Manager 的配置设置,以及数据库的内容。
  4. 删除处于 Non Operational 状态的主机,并在恢复的自承载环境中重新安装它们。

先决条件

  • 一个安装了全新 Red Hat Enterprise Linux 系统的物理主机来恢复自承载引擎环境。
  • 新的主机和 Manager 的操作系统版本必须和原来的版本相同。
  • 新环境需要具有 Red Hat Subscription Manager 权利。如需获得所需权利的完整列表,请参阅安装指南中的 Subscribing to the Required Entitlements
  • 新的 Manager 的完全限定域名需要和原始 Manager 的完全限定域名相同。DNS 中需要有它的正向和反向查询记录。

6.1. 备份自承载引擎 Manager 虚拟机

我们推荐您定期备份自承载引擎环境。在这里,支持的备份方法是使用 engine-backup,它可以在不影响 ovirt-engine 服务的情况下进行。engine-backup 只备份 Red Hat Enterprise Virtualization Manager 虚拟机,而不备份 Manager 虚拟机所在的主机。

过程 6.1. 备份原始的 Red Hat Enterprise Virtualization Manager

  1. 准备故障转移主机(failover host)

    故障转移主机(一个可以运行引擎的主机)需要被设置为维护模式,从而保证在备份时它没有运行虚拟机。这个主机在以后可以被用来部署恢复的自承载引擎环境。任何一个可以运行引擎的主机都可以作为一个故障转移主机,但是使用 Host 1 会使恢复的过程更加直接。Host 1 主机的默认名是 hosted_engine_1,它在 hosted-engine 部署脚本初始运行时被设置。
    1. 登录到可以运行引擎的一个主机上。
    2. 确认 hosted_engine_1 主机是 Host 1
       # hosted-engine --vm-status
    3. 登录到管理门户。
    4. 选择主机标签页。
    5. 在结果列表中选 hosted_engine_1 主机,点维护
    6. 确定
  2. 禁用高可用性代理

    在主机上禁用高可用性代理,这可以防止在进行备份的过程中发生 Red Hat Enterprise Virtualization Manager 虚拟机迁移操作。在管理门户中,点虚拟机资源标签页。在引擎虚拟机图标上点鼠标右键,选择启用全局 HA 维护把所有主机都设置为全局维护模式。
  3. 创建一个 Manager 的备份

    在 Manager 虚拟机上,备份配置设置和数据库的内容。把 [EngineBackupFile] 替换为备份文件的文件名;把 [LogFILE] 替换为备份日志文件的文件名。
    # engine-backup --mode=backup --file=[EngineBackupFile] --log=[LogFILE]
  4. 把备份文件复制到一个外部的服务器上

    把备份文件通过安全的方式复制到一个外部的服务器上。在以下的例子中,[Storage.example.com] 是保存备份文件的一个网络存储服务器的完全限定域名;/backup/ 是保存备份文件的目录或路径。虽然这一步并不是必需的,但您需要保证,在恢复配置和数据库内容时可以访问到备份文件。
    # scp -p [EngineBackupFiles] [Storage.example.com:/backup/EngineBackupFiles]
  5. 启用高可用性代理

    在管理门户中,点虚拟机资源标签页。在引擎虚拟机图标上点鼠标右键,选择禁用全局 HA 维护来关闭全局维护模式。这将启用高可用性代理。
  6. 激活故障转移主机

    取消 hosted_engine_1 主机的维护模式。
    1. 登录到管理门户。
    2. 选择主机标签页。
    3. 在结果列表中选 hosted_engine_1
    4. 激活
您已经备份了 Red Hat Enterprise Virtualization Manager 虚拟机的配置设置和数据库内容。

6.2. 创建一个新的自承载引擎环境作为恢复的环境

您可以在被备份环境中的硬件上恢复自承载引擎,但是必须使用故障转移(failover)主机。第 6.1 节 “备份自承载引擎 Manager 虚拟机” 中的故障转移主机(Host 1)使用默认的值作为主机名 - hosted_engine_1,这个主机名也在这里使用。因为自承载引擎恢复的特性,在对所恢复的引擎进行最后的同步前,使用的故障转移主机需要被删除(这要求在进行备份时,主机上没有运行任何虚拟机)。另外,您也可以在被备份环境外的硬件上进行恢复。

重要

本过程假设您已经在一台物理主机上全新安装了 Red Hat Enterprise Linux 系统,并为主机订阅了所需的权利,而且安装了 ovirt-hosted-engine-setup 软件包。如需了解更多信息,请参阅 第 3.1 节 “订阅所需的权利”第 3.2 节 “安装自承载引擎软件包”

过程 6.2. 创建一个新的自承载环境作为恢复的环境

  1. 更新 DNS

    更新 DNS,使 Red Hat Enterprise Virtualization 环境的完全限定域名与新 Manager 的 IP 地址相对应。在以下过程中,完全限定域名被设置为 Manager.example.com。引擎的完全限定域名需要和在设置被备份的原始引擎时使用的值相同。
  2. 初始化引擎

    在新安装的 Red Hat Enterprise Linux 主机上运行 hosted-engine 脚本开始部署的过程。您可以在任何时候使用 CTRL+D 键终止部署的过程。
    # hosted-engine --deploy
    如果需要通过网络运行 hosted-engine 部署脚本,我们推荐使用 screen 窗口管理程序。使用它可以在出现网络问题时保持当前运行的进程。如果还没有安装 screen,请先安装这个软件包。
    # screen hosted-engine --deploy
  3. 准备初始化

    脚本开始会要求您确认在自承载引擎环境中作为虚拟机管理程序(hypervisor)的主机信息。
    Continuing will configure this host for serving as hypervisor and create a VM where you have to install oVirt Engine afterwards. 
    Are you sure you want to continue? (Yes, No)[Yes]:
  4. 配置存储

    选择使用的存储类型。
    During customization use CTRL-D to abort.
    Please specify the storage you would like to use (iscsi, 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 地址、端口、用户名和密码,并从检测到的列表中选择一个目标名:
      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]:
    选择环境中使用的存储域和存储数据中心名。
    [ 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)访问 Manager 虚拟机的需要来修改防火墙的配置。另外,它还需要一个可以被 ping 到的网关 IP 地址,ovirt-ha-agent 会使用它来决定主机是否适合运行 Manager 虚拟机。
    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]: 
    Please indicate a pingable gateway IP address [X.X.X.X]:
    
  6. 配置新的 Manager 虚拟机

    这个脚本会创建一个新的 Manager 虚拟机。根据具体情况指定引导设备、安装媒体的路径名、镜像别名、CPU 类型、虚拟 CPU 的数量以及磁盘的大小。为 Manager 虚拟机指定一个 MAC 地址,或使用系统自动创建的地址。在为 Manager 虚拟机安装操作系统前,这个 MAC 地址可以被用来更新 DHCP 服务器。为所创建的 Manager 虚拟机指定内存的大小和控制台连接类型。
    Please specify the device to boot the VM from (cdrom, disk, pxe) [cdrom]: 
    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 minimum requirement: 2]: 
    Please specify the disk size of the VM in GB [Defaults to minimum requirement: 25]: 
    You may specify a MAC address for the VM or accept a randomly generated default [00:16:3e:77:b2:a4]: 
    Please specify the memory size of the VM in MB [Defaults to minimum requirement: 4096]: 
    Please specify the console type you want to use to connect to the VM (vnc, spice) [vnc]:
    
  7. 指定主机的名称

    为主机提供一个唯一的名称,避免与从备份中恢复的名称冲突。hosted_engine_1 这个名称可以在此使用,因为在进行备份前,这个主机已被设置为维护模式,它会在恢复引擎操作和在主机与引擎进行最后的同步操作间被删除。
    Enter the name which will be used to identify this host inside the Administration Portal [hosted_engine_1]:
  8. 配置引擎

    为自承载环境指定一个名称,为访问管理门户的 admin@internal 用户设定一个密码。提供新的 Manager 虚拟机的完全限定域名。在这里使用 Manager.example.com 作为完全限定域名。指定 SMTP 服务器的名称、TCP 端口号、发送通知电子邮件的电邮地址、接收通知的一组电邮地址(以逗号分隔)。

    重要

    为引擎提供的完全限定域名(Manager.example.com)必须和初始设置原始 Manager 时提供的完全限定域名相同。
    Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: 
    Confirm 'admin@internal' user password: 
    Please provide the FQDN for the engine you would like to use.
    This needs to match the FQDN that you will use for the engine installation within the VM.
     Note: This will be the FQDN of the VM you are now going to create,
     it should not point to the base host or to any other existing machine.
     Engine FQDN: Manager.example.com
    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]:
  9. 配置预览

    在实际进行配置前,hosted-engine 脚本会显示您已输入的信息,并提示您确认这些信息。
    Bridge interface                   : eth1
    Engine FQDN                        : Manager.example.com
    Bridge name                        : rhevm
    SSH daemon port                    : 22
    Firewall manager                   : iptables
    Gateway address                    : X.X.X.X
    Host name for web application      : hosted_engine_1
    Host ID                            : 1
    Image alias                        : hosted_engine
    Image size GB                      : 25
    Storage connection                 : storage.example.com:/hosted_engine/nfs
    Console type                       : vnc
    Memory size MB                     : 4096
    MAC address                        : 00:16:3e:77:b2:a4
    Boot type                          : pxe
    Number of CPUs                     : 2
    CPU Type                           : model_Penryn
    
    Please confirm installation settings (Yes, No)[Yes]:
    
  10. 创建新的 Manager 虚拟机

    这个脚本创建的虚拟机会被配置为 Manager 虚拟机,并提供和它进行连接的详情信息。在 hosted-engine 脚本可以继续配置引擎前,您需要在这个虚拟机上安装一个操作系统 。
    [ INFO  ] Stage: Transaction setup
    [ INFO  ] Stage: Misc configuration
    [ INFO  ] Stage: Package installation
    [ INFO  ] Stage: Misc configuration
    [ INFO  ] Configuring libvirt
    [ INFO  ] Configuring VDSM
    [ INFO  ] Starting vdsmd
    [ INFO  ] Waiting for VDSM hardware info
    [ INFO  ] Waiting for VDSM hardware info
    [ INFO  ] Configuring the management bridge
    [ INFO  ] Creating Storage Domain
    [ INFO  ] Creating Storage Pool
    [ INFO  ] Connecting Storage Pool
    [ INFO  ] Verifying sanlock lockspace initialization
    [ INFO  ] Creating VM Image
    [ INFO  ] Disconnecting Storage Pool
    [ INFO  ] Start monitoring domain
    [ INFO  ] Configuring VM
    [ INFO  ] Updating hosted-engine configuration
    [ INFO  ] Stage: Transaction commit
    [ INFO  ] Stage: Closing up
    [ INFO  ] Creating VM
    You can now connect to the VM with the following command:
          /usr/bin/remote-viewer vnc://localhost:5900
    Use temporary password "3477XXAM" 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 console using the following command:
    virsh -c qemu+tls://Test/system console HostedEngine
    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
    The VM has been started.  Install the OS and shut down or reboot it.  To continue please make a selection:
             
      (1) Continue setup - VM installation is complete
      (2) Reboot the VM and restart installation
      (3) Abort setup
      (4) Destroy VM and abort setup
             
      (1, 2, 3, 4)[1]:
    使用以下命令通过 VNC 连接到虚拟机:
    /usr/bin/remote-viewer vnc://hosted_engine_1.example.com:5900
  11. 安装虚拟机操作系统

    连接到 Manager 虚拟机,安装 Red Hat Enterprise Linux 6.5、6.6 或 6.7 操作系统。
  12. 把主机和 Manager 进行同步

    返回到主机,选择选项 1 来继续 hosted-engine 脚本:
    (1) Continue setup - VM installation is complete
    Waiting for VM to shut down...
    [ INFO  ] Creating VM
    You can now connect to the VM with the following command:
          /usr/bin/remote-viewer vnc://localhost:5900
    Use temporary password "3477XXAM" 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 console using the following command:
    virsh -c qemu+tls://Test/system console HostedEngine
    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
    Please install and setup the engine in the VM.
    You may also be interested in subscribing to "agent" RHN/Satellite channel and installing rhevm-guest-agent-common package in the VM.
    To continue make a selection from the options below:
      (1) Continue setup - engine installation is complete
      (2) Power off and restart the VM
      (3) Abort setup
      (4) Destroy VM and abort setup
             
      (1, 2, 3, 4)[1]:
  13. 安装 Manager

    连接到新的 Manager 虚拟机,确认所有安装的软件包都是最新版本,安装 rhevm 软件包。
    # yum update
    # yum install rhevm
  14. 安装 Reports 和 Data Warehouse

    如果您同时需要恢复 Reports 和 Data Warehouse,则需要安装 rhevm-reports-setuprhevm-dwh-setup 软件包。
    # yum install rhevm-reports-setup rhevm-dwh-setup
在软件包安装完成后,您就可以继续自承载引擎 Manager 的恢复过程。

6.3. 恢复自承载引擎 Manager

以下介绍了如何通过备份恢复一个自承载引擎 Manager 虚拟机的配置信息和数据库内容。

过程 6.3. 恢复自承载引擎 Manager

  1. 手工创建一个空的数据库来保存从备份中恢复的数据库内容。以下操作需要在数据库所在的机器上执行。
    1. 如果数据库不在 Manager 虚拟机上,则需要安装 postgresql-server 软件包。如果虚拟机位于 Manager 所在的虚拟机上,则不需要进行这一步,因为这个软件包已包括在 rhevm 软件包中。
      # yum install postgresql-server
    2. 初始化 postgresql 数据库,启动 postgresql 服务,把它设置为在系统引导时被自动启动:
      # service postgresql initdb
      # service postgresql start
      # chkconfig postgresql on
    3. 进入 postgresql 命令行:
      # su postgres
      $ psql
    4. 创建 engine 用户:
      postgres=# create role engine with login encrypted password 'password';
      如果您还需要恢复 Reports 和 Data Warehouse,在相关的主机上创建 ovirt_engine_reportsovirt_engine_history 用户:
      postgres=# create role ovirt_engine_reports with login encrypted password 'password';
      postgres=# create role ovirt_engine_history with login encrypted password 'password';
    5. 创建新数据库:
      postgres=# create database database_name owner engine template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
      如果您还需要恢复 Reports 和 Data Warehouse,在相关的主机上创建数据库:
      postgres=# create database database_name owner ovirt_engine_reports template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
      postgres=# create database database_name owner ovirt_engine_history template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
    6. 退出 postgresql 命令行并登出 postgres 用户:
      postgres=# \q
      $ exit
    7. 编辑 /var/lib/pgsql/data/pg_hba.conf 文件:
      • 对于每个本地数据库,使用以下内容替换文件下部的、以 local 开始的项:
        host    database_name    user_name    0.0.0.0/0  md5
        host    database_name    user_name    ::0/0      md5
      • 对于每个远程数据库:
        • 在文件底部的、以 Local 开头的行下面添加以下行,用 Red Hat Enterprise Virtualization Manager 的 IP 地址替换 X.X.X.X
          host    database_name    user_name    X.X.X.X/32   md5
        • 允许 TCP/IP 到数据库的连接。编辑 /var/lib/pgsql/data/postgresql.conf 文件,添加以下行:
          listen_addresses='*'
          在这个例子中,postgresql 服务被配置为监听所有接口上的连接。您可以使用 IP 地址来指定只监听特定接口上的连接。
        • 修改防火墙规则来打开 PostgreSQL 数据库连接所使用的默认端口,然后保存更新的防火墙规则:
          # iptables -I INPUT 5 -p tcp -s Manager_IP_Address --dport 5432 -j ACCEPT
          # service iptables save
    8. 重启 postgresql 服务:
      # service postgresql restart
  2. 把备份文件复制到新的 Manager 所在的机器上

    把备份文件安全地复制到新的 Manager 虚拟机上。此例会把文件从一个网络存储服务器复制到 第 6.1 节 “备份自承载引擎 Manager 虚拟机” 所复制的文件中。Storage.example.com 是存储服务器的完全限定域名;/backup/EngineBackupFiles 是备份文件在存储服务器上的文件路径;/backup/ 是文件要被复制到的、在新 Manager 机器上的文件路径。
    # scp -p Storage.example.com:/backup/EngineBackupFiles /backup/
  3. 恢复一个完整备份或数据库备份(通过 --change-db-credentials 参数指定新数据库的凭证信息)。Manager 本地数据库的 database_locationlocalhost

    注意

    在以下的例子中,对于每个数据库都使用了没有指定密码的 --*password 选项,这会使数据库在相应的阶段要求用户输入密码。虽然可以在命令中使用这些选项指定密码,但是这些密码信息会被保存在 shell 的历史记录中,因此我们不推荐使用这个方法来提供密码。另外,也可以选择使用 --*passfile=password_file 选项来为 engine-backup 安全地传递每个数据库的密码,而不再需要人工输入密码。
    • 恢复一个完全备份:
      # engine-backup --mode=restore --file=file_name --log=log_file_name --change-db-credentials --db-host=database_location --db-name=database_name --db-user=engine --db-password
      如果需要恢复作为完全备份一部分的 Reports 和 Data Warehouse,则要包括这两个数据库的凭证:
      engine-backup --mode=restore --file=file_name --log=log_file_name --change-db-credentials --db-host=database_location --db-name=database_name --db-user=engine --db-password --change-reports-db-credentials --reports-db-host=database_location --reports-db-name=database_name --reports-db-user=ovirt_engine_reports --reports-db-password --change-dwh-db-credentials --dwh-db-host=database_location --dwh-db-name=database_name --dwh-db-user=ovirt_engine_history --dwh-db-password
    • 恢复数据库备份会首先恢复配置文件备份,然后再恢复数据库备份:
      # engine-backup --mode=restore --scope=files --file=file_name --log=log_file_name
      # engine-backup --mode=restore --scope=db --file=file_name --log=file_name --change-db-credentials --db-host=database_location --db-name=database_name --db-user=engine --db-password
      以上例子恢复了 Manager 数据库的备份。
      # engine-backup --mode=restore --scope=reportsdb --file=file_name --log=file_name --change-reports-db-credentials --reports-db-host=database_location --reports-db-name=database_name --reports-db-user=ovirt_engine_reports --reports-db-password
      以上例子恢复了 Reports 数据库的备份。
      # engine-backup --mode=restore --scope=dwhdb --file=file_name --log=file_name --change-dwh-db-credentials --dwh-db-host=database_location --dwh-db-name=database_name --dwh-db-user=ovirt_engine_history --dwh-db-password
      以上例子恢复了 Data Warehouse 数据库的备份。
    如果运行成功,以下输出会被显示:
    You should now run engine-setup.
    Done.
  4. 配置 Manager

    配置恢复的 Manager 虚拟机。这个过程会检测到存在的配置设置和数据库内容。确认这些设置。完成后,系统会提供一个 SSH 指纹(fingerprint)和一个内部的证书授权哈希数据(Certificate Authority hash)。
    # engine-setup
    [ INFO  ] Stage: Initializing
    [ INFO  ] Stage: Environment setup
    Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']
    Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20140304075238.log
    Version: otopi-1.1.2 (otopi-1.1.2-1.el6ev)
    [ INFO  ] Stage: Environment packages setup
    [ INFO  ] Yum Downloading: rhel-65-zstream/primary_db 2.8 M(70%)
    [ INFO  ] Stage: Programs detection
    [ INFO  ] Stage: Environment setup
    [ INFO  ] Stage: Environment customization
             
              --== PACKAGES ==--
             
    [ INFO  ] Checking for product updates...
    [ INFO  ] No product updates found
             
              --== NETWORK CONFIGURATION ==--
             
    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]: 
    [ INFO  ] iptables will be configured as firewall manager.
             
              --== DATABASE CONFIGURATION ==--
             
             
              --== OVIRT ENGINE CONFIGURATION ==--
             
              Skipping storing options as database already prepared
             
              --== PKI CONFIGURATION ==--
             
              PKI is already configured
             
              --== APACHE CONFIGURATION ==--
             
             
              --== SYSTEM CONFIGURATION ==--
             
             
              --== END OF CONFIGURATION ==--
             
    [ INFO  ] Stage: Setup validation
    [ INFO  ] Cleaning stale zombie tasks
             
              --== CONFIGURATION PREVIEW ==--
             
              Database name                      : engine
              Database secured connection        : False
              Database host                      : X.X.X.X
              Database user name                 : engine
              Database host name validation      : False
              Database port                      : 5432
              NFS setup                          : True
              Firewall manager                   : iptables
              Update Firewall                    : True
              Configure WebSocket Proxy          : True
              Host FQDN                          : Manager.example.com
              NFS mount point                    : /var/lib/exports/iso
              Set application as default page    : True
              Configure Apache SSL               : True
             
              Please confirm installation settings (OK, Cancel) [OK]:
  5. 从恢复的环境中删除主机

    如果被恢复的自承载引擎部署在一个新硬件中,而这个硬件系统的名称没有出现在备份的引擎中,则跳过这一步。这一步只适用于在一个故障转移主机上(hosted_engine_1)进行部署的情况。因为这个主机在备份时已存在,它仍然还会存在于恢复的引擎中。因此,在进行最后的同步前,需要把它先从环境中删除。
    1. 登录到管理门户
    2. 主机标签页。故障转移主机(hosted_engine_1)会处于维护模式,而且没有运行任何虚拟机。
    3. 删除
    4. 确定
  6. 把主机和 Manager 进行同步

    返回到主机,选择选项 1 来继续 hosted-engine 脚本:
    (1) Continue setup - engine installation is complete
    [ INFO  ] Engine replied: DB Up!Welcome to Health Status!
    [ 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...
    在此阶段,hosted_engine_1 会出现在管理门户中,它的状态会在变为 Non Operational 前经历 Installing 状态和 Initializing 状态。主机会等待 VDSM 主机变为正常运行的状态,并最终发生超时。这是因为环境中的另外一个主机具有 SPM 角色,而这个具有 SPM 角色的主机处于 Non Responsive 的状态,因此,hosted_engine_1 无法和存储域进行交流。当超时发生时,您会被提示关闭虚拟机来完成部署的过程。当部署完成后,主机可以被手工设置为维护模式,并通过管理门户激活。
    [ INFO  ] Still waiting for VDSM host to become operational...
    [ ERROR ] Timed out while waiting for host to start. Please check the logs.
    [ ERROR ] Unable to add hosted_engine_2 to the manager
              Please shutdown the VM allowing the system to launch it as a monitored service.
              The system will wait until the VM is down.
  7. 关闭 Manager

    关闭新的 Manager 虚拟机。
    # shutdown -h now
  8. 设置确认

    返回到主机,确认它检测到 Manager 虚拟机已被关闭。
    [ INFO  ] Enabling and starting HA services
              Hosted Engine successfully set up
    [ INFO  ] Stage: Clean up
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
  9. 激活主机

    1. 登录到管理门户
    2. 主机标签页。
    3. hosted_engine_1 并点维护按钮。主机可能会需要几分钟时间进入维护模式。
    4. 激活按钮。
    一旦激活后,hosted_engine_1 就可以竞争成为 SPM,存储域和数据中心都变为活跃状态。
  10. 把虚拟机迁移到活跃的主机上

    对状态为 Non Responsive 的主机进行手工隔离(fencing),这会使它上面的虚拟机迁移到其它活跃的主机上。在管理门户中,点主机右键,选确认“主机已被重启”
    当进行备份时在那个主机上运行的所有虚拟机都会被从那个主机上删除,并从 Unknown 状态变为 Down 状态。这些虚拟机现在可以在 hosted_engine_1 上运行。使用 REST API 把被隔离的主机强制删除。
现在,这个环境已被恢复到 hosted_engine_1 活跃时的状态,并可以在恢复的环境中运行虚拟机。那些处于 Non Operational 状态的、可以运行引擎的主机现在就可以被删除,并在新环境中重新安装。

6.4. 从恢复的自承载引擎环境中删除状态为 Non-Operational 的主机

当一个主机通过管理门户被隔离(fencing) 后,就可以使用 REST API 请求强制删除它。这个过程会使用 cURL(一个命令行接口,多数 Linux 发行版本都会包括它)向 HTTP 服务器发送一个请求。它会连接到 Manager 虚拟机来进行相关的请求。
  1. 隔离无法正常工作的主机

    在管理门户中,在主机上点鼠标右键,选确认“主机已被重启”
    当进行备份时在那个主机上运行的所有虚拟机都会被从那个主机上删除,并从 Unknown 状态变为 Down 状态。使用 REST API 把被隔离的主机强制删除。
  2. 获得 Manager 的证书颁发机构(CA)

    连接到 Manager 虚拟机,在命令行中使用 cURL 进行以下请求。
    使用 GET 请求获得 Manager 的 CA 以供今后的 API 请求使用。在下面的示例中,使用 --output 选项指定 hosted-engine.ca 文件作为 Manager CA 证书的输出。--insecure 选项意味着这个初始的请求不包括证书。
    # curl --output hosted-engine.ca --insecure https://[Manager.example.com]/ca.crt
  3. 获得要被删除的主机的 GUID

    在主机集合中使用一个 GET 请求获得要被删除的主机的 GUID。以下例子中包括了 Manager CA 证书文件,使用 admin@internal 用户进行验证,并在命令执行过程中会被提示输入它的密码。
    # curl --request GET --cacert hosted-engine.ca --user admin@internal https://[Manager.example.com]/api/hosts
    这个请求会返回环境中所有主机的信息。主机的 GUID 是和主机名相连的十六进制字符串。如需了解更多与 Red Hat Enterprise Virtualization REST API 相关的信息,请参阅 Red Hat Enterprise Virtualization REST API Guide
  4. 删除隔离的主机

    使用带有被隔离主机的 GUID 的 DELETE 请求从环境中删除这个主机。除了以前请求中使用的参数,这个例子中的请求还包括使用 XML 的头(header),以及内容(body)项。在内容项中,把 force 操作设置为 true
    curl --request DELETE --cacert hosted-engine.ca --user admin@internal --header "Content-Type: application/xml" --header "Accept: application/xml" --data "<action><force>true</force></action>" https://[Manager.example.com]/api/hosts/ecde42b0-de2f-48fe-aa23-1ebd5196b4a5
    通过使用相应的 GUID,这个 DELETE 请求可以被用来删除自承载引擎环境中的每一个被隔离的主机。
当主机被删除后,就可以在自承载引擎环境中对它们进行重新安装。

6.5. 安装额外的主机来恢复自承载引擎环境

重新安装那些在进行备份时存在于自承载引擎环境中的、可以用来运行引擎的主机的过程会和添加新主机的过程有一点不同。重新安装主机会和第一个主机一样,在和引擎进行同步时出现同样的 VDSM 超时问题。

预备条件

  • 为了重新使用一个主机,这个主机被重启安装前,需要已从环境中删除。
  • 已在一台物理主机上全新安装了 Red Hat Enterprise Linux 系统,并为主机订阅了所需的权利。如需了解更多与订阅相关的信息,请参阅 第 3.1 节 “订阅所需的权利”

过程 6.4. 添加主机

  1. 安装 ovirt-hosted-engine-setup 软件包。
    # yum install ovirt-hosted-engine-setup
  2. 配置主机。
    # hosted-engine --deploy
    如果需要通过网络运行 hosted-engine 部署脚本,我们推荐使用 screen 窗口管理程序。使用它可以在出现网络问题时保持当前运行的进程。如果还没有安装 screen,请先安装这个软件包。
    # screen hosted-engine --deploy
  3. 准备初始化

    脚本开始会要求您确认在自承载引擎环境中作为虚拟机管理程序(hypervisor)的主机信息。
    Continuing will configure this host for serving as hypervisor and create a VM where you have to install oVirt Engine afterwards. 
    Are you sure you want to continue? (Yes, No)[Yes]:
  4. 配置存储

    选择使用的存储类型。
    During customization use CTRL-D to abort.
    Please specify the storage you would like to use (iscsi, 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 地址、端口、用户名和密码,并从检测到的列表中选择一个目标名:
      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]:
  5. 检测自承载引擎

    hosted-engine 脚本会检测正在被使用的共享存储,并要求用户输入是否存在一个额外的主机。另外,用户还会被提示输入主机 ID,这个 ID 必须还没有分配给这个环境中的任何主机。
    The specified storage location already contains a data domain. Is this an additional host setup (Yes, No)[Yes]? 
    [ INFO  ] Installing on additional host
    Please specify the Host ID [Must be integer, default: 2]:
    
  6. 配置系统

    hosted-engine 脚本使用在进行原始引擎主机设置时产生的应答文件进行配置。为了可以把应答文件复制到要安装的额外主机上,脚本需要知道原始引擎所在主机的 FQDN 或 IP 地址,以及它的 root 用户密码。
    [WARNING] A configuration file must be supplied to deploy Hosted Engine on an additional host.
    The answer file may be fetched from the first host using scp.
    If you do not want to download it automatically you can abort the setup answering no to the following question.
    Do you want to scp the answer file from the first host? (Yes, No)[Yes]:       
    Please provide the FQDN or IP of the first host:           
    Enter 'root' user password for host [hosted_engine_1.example.com]: 
    [ INFO  ] Answer file successfully downloaded
    
  7. 配置引擎

    指定要安装的额外主机在 Red Hat Enterprise Virtualization 环境中使用的名称,以及 admin@internal 用户的密码。这个名称必须没有被环境中的其它任何主机使用。
    Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_2]:           
    Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: 
    Confirm 'admin@internal' user password:
    
  8. 配置预览

    在实际进行配置前,hosted-engine 脚本会显示您已输入的信息,并提示您确认这些信息。
    Bridge interface                   : eth1
    Engine FQDN                        : HostedEngine-VM.example.com
    Bridge name                        : rhevm
    SSH daemon port                    : 22
    Firewall manager                   : iptables
    Gateway address                    : X.X.X.X
    Host name for web application      : hosted_engine_2
    Host ID                            : 2
    Image size GB                      : 25
    Storage connection                 : storage.example.com:/hosted_engine/nfs
    Console type                       : vnc
    Memory size MB                     : 4096
    MAC address                        : 00:16:3e:05:95:50
    Boot type                          : disk
    Number of CPUs                     : 2
    CPU Type                           : model_Penryn
             
    Please confirm installation settings (Yes, No)[Yes]:
    
  9. 确认引擎安装完成

    在脚本提示进行选择时,额外的主机会和 Manager 和 hosted_engine_1 进行联系。选择选项 1 继续。
    [ INFO  ] Stage: Closing up
    To continue make a selection from the options below:
      (1) Continue setup - engine installation is complete
      (2) Power off and restart the VM
      (3) Abort setup
      (4) Destroy VM and abort setup
             
      (1, 2, 3, 4)[1]
  10. [ INFO  ] Engine replied: DB Up!Welcome to Health Status!
    [ INFO  ] Waiting for the host to become operational in the engine. This may take several minutes...
    在此阶段,主机会出现在管理门户中,它的状态会在变为 Non Operational 前经历 Installing 状态和 Initializing 状态。主机会等待 VDSM 主机变为正常运行的状态,并最终发生超时。
    [ INFO  ] Still waiting for VDSM host to become operational...
    [ INFO  ] Still waiting for VDSM host to become operational...
    [ ERROR ] Timed out while waiting for host to start. Please check the logs.
    [ ERROR ] Unable to add hosted_engine_1 to the manager
    [ INFO  ] Enabling and starting HA services
              Hosted Engine successfully set up
    [ INFO  ] Stage: Clean up
    [ INFO  ] Generating answer file '/etc/ovirt-hosted-engine/answers.conf'
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
  11. 激活主机

    1. 登录到管理门户
    2. 主机标签页,选择要被激活的主机。
    3. 激活按钮。
主机现在就可以运行 Manager 虚拟机,以及当前正在其它主机上运行的虚拟机。

第 7 章 在自承载环境中安装额外的主机

在自承载环境中添加额外的主机与部署原始的自承载引擎主机的过程相似,但会更简化一些。在一个新主机上运行 hosted-engine 脚本,共享的存储域会被检测到,新主机会在需要时作为故障转移主机来运行 Manager 虚拟机。您还可以在自承载的环境中附加一般的主机(不需要使用 hosted-engine 脚本进行配置),但它们不能运行 Manager 虚拟机。我们强烈推荐使用最少两个通过 hosted-engine 配置的主机来实现 Manager 虚拟机的高可用性功能。

预备条件

  • 已在一台物理主机上全新安装了 Red Hat Enterprise Linux 系统,并为主机订阅了所需的权利。如需了解更多与订阅相关的信息,请参阅 第 3.1 节 “订阅所需的权利”

过程 7.1. 添加主机

  1. 安装 ovirt-hosted-engine-setup 软件包。
    # yum install ovirt-hosted-engine-setup
  2. 配置主机。
    # hosted-engine --deploy
  3. 配置存储

    选择使用的存储类型。
    During customization use CTRL-D to abort.
    Please specify the storage you would like to use (iscsi, 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 地址、端口、用户名和密码,并从检测到的列表中选择一个目标名:
      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]:
  4. 检测自承载引擎

    hosted-engine 脚本会检测正在被使用的共享存储,并要求用户输入是否存在一个额外的主机。另外,用户还会被提示输入主机 ID,这个 ID 必须还没有分配给这个环境中的任何主机。
    The specified storage location already contains a data domain. Is this an additional host setup (Yes, No)[Yes]? 
    [ INFO  ] Installing on additional host
    Please specify the Host ID [Must be integer, default: 2]:
    
  5. 配置系统

    hosted-engine 脚本使用在进行原始引擎主机设置时产生的应答文件进行配置。为了可以把应答文件复制到要安装的额外主机上,脚本需要知道原始引擎所在主机的 FQDN 或 IP 地址,以及它的 root 用户密码。
    [WARNING] A configuration file must be supplied to deploy Hosted Engine on an additional host.
    The answer file may be fetched from the first host using scp.
    If you do not want to download it automatically you can abort the setup answering no to the following question.
    Do you want to scp the answer file from the first host? (Yes, No)[Yes]:       
    Please provide the FQDN or IP of the first host:           
    Enter 'root' user password for host Host-HE1.example.com: 
    [ INFO  ] Answer file successfully downloaded
    
  6. 配置引擎

    指定要安装的额外主机在 Red Hat Enterprise Virtualization 环境中使用的名称,以及 admin@internal 用户的密码。
    Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_2]:           
    Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: 
    Confirm 'admin@internal' user password:
    
  7. 配置预览

    在实际进行配置前,hosted-engine 脚本会显示您已输入的信息,并提示您确认这些信息。
    Bridge interface                   : eth1
    Engine FQDN                        : HostedEngine-VM.example.com
    Bridge name                        : rhevm
    SSH daemon port                    : 22
    Firewall manager                   : iptables
    Gateway address                    : X.X.X.X
    Host name for web application      : hosted_engine_2
    Host ID                            : 2
    Image size GB                      : 25
    Storage connection                 : storage.example.com:/hosted_engine/nfs
    Console type                       : vnc
    Memory size MB                     : 4096
    MAC address                        : 00:16:3e:05:95:50
    Boot type                          : disk
    Number of CPUs                     : 2
    CPU Type                           : model_Penryn
             
    Please confirm installation settings (Yes, No)[Yes]:
    
在用户确认所输入的信息后,脚本会完成主机安装的操作,并把它加入到环境中。

第 8 章 迁移数据库

8.1. 把自承载引擎数据库迁移到一个远程服务器数据库中

当 Red Hat Enterprise Virtualization Manager 被初始配置后,您可以把自承载引擎的 engine 数据库迁移到一个远程的数据库服务器。
这个任务被分为两个步骤。第一个步骤:准备远程的 PostgreSQL 数据库。远程数据库服务器需要安装并配置了 Red Hat Enterprise Linux,并且具有所需的订阅。
第二个步骤:迁移数据库,使用 PostgreSQL 的 pg_dumppg_restore 命令来处理数据库的备份和恢复。编辑 /etc/ovirt-engine/engine.conf.d/10-setup-database.conf 文件来包括更新的信息,最少需要更新新数据库服务器的位置信息。如果新数据库服务器中的数据库名称、角色名称或密码也有变化,这些信息也需要在 10-setup-database.conf 文件中进行相应的更新。在这里介绍的步骤中,为了尽量简化对这些文件的修改,我们使用了默认的 engine 数据库设置。

过程 8.1. 为 Red Hat Enterprise Virtualization Manager 准备远程 PostgreSQL 数据库

  1. 登录到远程数据库服务器并安装 PostgreSQL server 软件包:
    # yum install postgresql-server
  2. 初始化 PostgreSQL 数据库,启动 postgresql 服务,把它设置为在系统引导时被自动启动:
    # service postgresql initdb
    # service postgresql start
    # chkconfig postgresql on
  3. 使用 postgres 用户连接到 psql 命令行界面:
    # su - postgres
    $ psql
  4. 为 Manager 读写数据库创建一个用户。Manager 的默认用户名是 engine
    postgres=# create role user_name with login encrypted password 'password';

    注意

    engine 用户的密码以明码形式保存在 /etc/ovirt-engine/engine.conf.d/10-setup-database.conf 文件中。在新服务器上创建的角色可以使用任何密码,但如果新密码和保存在这个文件中的密码不同,则需要修改这个文件中的密码。
  5. 创建一个用来保存 Red Hat Enterprise Virtualization 环境信息的数据库。Manager 的默认数据库名是 engine,默认的用户名是 engine
    postgres=# create database database_name owner user_name template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
  6. 启用 md5 客户验证机制来允许对数据库进行访问。编辑 /var/lib/pgsql/data/pg_hba.conf 文件,在文件底部的、以 local 开头的行的下面添加以下内容(使用 Manager 的 IP 地址替换 X.X.X.X 的值):
    host    database_name    user_name    X.X.X.X/32   md5
  7. 允许 TCP/IP 到数据库的连接。编辑 /var/lib/pgsql/data/postgresql.conf 文件,添加以下行:
    listen_addresses='*'
    在这个例子中,postgresql 服务被配置为监听所有接口上的连接。您可以使用 IP 地址来指定只监听特定接口上的连接。
  8. 打开 PostgreSQL 数据库连接所使用的默认端口,保存更新的防火墙规则:
    # iptables -I INPUT 5 -p tcp --dport 5432 -j ACCEPT
    # service iptables save
  9. 重启 postgresql 服务:
    # service postgresql restart
另外,可以设置 SSL 来进行安全的数据库连接(请参阅 http://www.postgresql.org/docs/8.4/static/ssl-tcp.html#SSL-FILE-USAGE)。

过程 8.2. 迁移数据库

  1. 登录到任何一个运行引擎的主机,把环境设置为 global 维护模式。这会禁用高可用性代理,并防止在进行数据库迁移过程中出现 Manager 迁移的情况:
    # hosted-engine --set-maintenance --mode=global
  2. 登录到 Manager 虚拟机,停止 ovirt-engine 服务,从而使它不会影响到引擎的备份:
    # service ovirt-engine stop
  3. 使用 PostgreSQL 的 pg_dump 命令创建 engine 数据库的备份:
    # su - postgres -c 'pg_dump -F c engine -f /tmp/engine.dump'
  4. 把备份文件复制到新的数据库中。目标目录需要允许 postgres 用户对它的访问:
    # scp /tmp/engine.dump root@new.database.server.com:/tmp/engine.dump
  5. 登录到新数据库服务器,使用 PostgreSQL 的 pg_restore 命令恢复数据库:
    # su - postgres -c 'pg_restore -d engine /tmp/engine.dump'
  6. 登录到 Manager 虚拟机,更新 /etc/ovirt-engine/engine.conf.d/10-setup-database.conf 文件中的设置。使用新数据库服务器的 IP 地址替换 ENGINE_DB_HOSTlocalhost。如果新数据库服务器的引擎名称、角色名称或密码也有变化,则还需修改这个文件中的相应值。
  7. 现在,数据库已被迁移,启动 ovirt-engine 服务:
    # service ovirt-engine start
  8. 登录到运行引擎的主机,关闭维护模式,启用高可用性代理:
    # hosted-engine --set-maintenance --mode=none

8.2. 把 Data Warehouse 服务和 Reports 服务迁移到独立的机器上

把 Data Warehouse 服务、Reports 服务或全部两个服务从 Red Hat Enterprise Virtualization Manager 迁移到独立的机器上。在独立的机器上运行 Data Warehouse 服务和 Reports 服务会减轻单个机器的负载,并可以避免因为不同进程间的 CPU 和内存共享导致的不同服务间的相互影响。
迁移 Data Warehouse 服务,并把它和存在的 ovirt_engine_history 数据库进行连接;或在迁移 Data Warehouse 服务前,把 ovirt_engine_history 数据库迁移到一个新的数据库机器上。如果 ovirt_engine_history 数据库原来存在于 Manager 所在的机器上,迁移 Data Warehouse 服务的同时迁移这个数据库,可以进一步减轻 Manager 所在机器的负载。您可以把数据库迁移到 Data Warehouse 服务所在的机器上,也可以把它迁移到一个完全独立的机器上。

8.3. 把 Data Warehouse 数据库迁移到一个独立的机器上

在迁移 Data Warehouse 服务前,您也可以选择迁移 ovirt_engine_history 数据库。使用 pg_dump 命令创建一个数据库备份,再使用 psql 命令在新数据库中恢复数据库备份。pg_dump 命令提供了一组灵活的备份和恢复数据库的选项,如需了解相关信息,请参阅 pg_dump 的 man 页。
以下过程假设一个 PostgreSQL 数据库已经在新机器上被配置。如果只迁移 Data Warehouse 服务,请参阅 第 8.4 节 “把 Data Warehouse 服务迁移到一个独立的机器上”

重要

如果当前的 Data Warehouse 数据库还和 Reports 服务相连,您需要运行 engine-setup 命令来重新配置这个服务。在命令的相关提示中输入新的 Data Warehouse 数据库信息。如果您没有进行这个操作,Reports 服务会仍然和旧的数据库进行连接,并无法获得新数据。

过程 8.3. 把 Data Warehouse 数据库迁移到一个独立的机器上

  1. 在当前的数据库所在机器上,把 ovirt_engine_history 数据库输出到一个 SQL 脚本文件中:
    # pg_dump ovirt_engine_history > ovirt_engine_history.sql
  2. 把这个脚本文件从当前数据库所在的机器复制到新数据库所在的机器上。
  3. 在新数据库所在机器上恢复 ovirt_engine_history 数据库:
    # psql -d ovirt_engine_history -f ovirt_engine_history.sql
    以上命令假设新数据库已被命名为 ovirt_engine_history

8.4. 把 Data Warehouse 服务迁移到一个独立的机器上

把 Data Warehouse 服务从 Red Hat Enterprise Virtualization Manager 所在的机器迁移到一个专门的机器上。在一个独立的机器上运行 Data Warehouse 服务可以减少 Manager 所在机器的负载。请注意,这里所介绍的过程只迁移 Data Warehouse 服务,如需在迁移 Data Warehouse 服务前迁移它的数据库(也被称为 ovirt_engine_history 数据库),请参阅 第 8.3 节 “把 Data Warehouse 数据库迁移到一个独立的机器上”
这个操作会涉及到 4 个关键步骤:
  1. 设置新的 Data Warehouse 机器。
  2. 在 Manager 所在的机器上停止 Data Warehouse 服务。
  3. 配置新的 Data Warehouse 机器。
  4. 从 Manager 所在的机器上删除 Data Warehouse 软件包。
先决条件

请确认您已经满足了以下前提条件。

  1. 已在同一台机器上安装并配置了 Manager 和 Data Warehouse。
  2. 为了设置新的 Data Warehouse 机器,您需要:
    • 安装了 Red Hat Enterprise Linux 6.6 或 6.7 的虚拟机或物理机。
    • 订阅了 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 权利池。
    • Manager 的 /etc/ovirt-engine/engine.conf.d/10-setup-database.conf 文件中的密码。.
    • 允许从 Data Warehouse 所在机器上访问 Manager 数据库所在机器的 TCP 端口 5432。
    • Manager 所在系统上的 /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf 文件中的 ovirt_engine_history 数据库凭证。如果您根据 第 8.3 节 “把 Data Warehouse 数据库迁移到一个独立的机器上” 的介绍迁移了 ovirt_engine_history 数据库,则需要获得在设置数据库时设定的用户凭证。

过程 8.4. 第 1 步:设置新的 Data Warehouse 机器

  1. 在 Content Delivery Network 中注册您的系统,在出现提示时输入您的 Customer Portal 用户名和密码:
    # subscription-manager register
  2. 找到 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池,并记录下它们的 ID。
    # subscription-manager list --available
  3. 使用前一步获得的池 ID 为系统附加权利:
    # subscription-manager attach --pool=pool_id
  4. 禁用所有存在的软件仓库:
    # subscription-manager repos --disable=*
  5. 启用所需的频道:
    # subscription-manager repos --enable=rhel-6-server-rpms
    # subscription-manager repos --enable=rhel-6-server-supplementary-rpms
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    # subscription-manager repos --enable=jb-eap-6-for-rhel-6-server-rpms
  6. 确认当前安装的软件包已被升级到最新版本:
    # yum update
  7. 安装 rhevm-dwh-setup 软件包:
    # yum install rhevm-dwh-setup

过程 8.5. 第 2 步:在 Manager 的机器上停止 Data Warehouse 服务

  1. 停止 Data Warehouse 服务:
    # service ovirt-engine-dwhd stop
  2. 如果 ovirt_engine_history 数据库、Manager 数据库或这两个数据库都运行在 Manager 所在的机器上,而且是由一个较早版本的系统(Red Hat Enterprise Virtualization 3.4 或更早版本)所配置,然后进行了升级,则需要保证新的 Data Warehouse 机器可以访问它们。打开 /var/lib/pgsql/data/postgresql.conf 文件并把 listen_addresses 行的内容修改为:
    listen_addresses = '*'
    如果这行没有存在或被注释掉,您需要手工添加它。
    如果数据库位于远程的机器上,您需要手工配置访问权限(编辑每台机器上的 postgres.conf 文件,根据上面的介绍添加 listen_addresses 行)。如果两个数据库都位于 Manager 所在的机器上,并通过 Red Hat Enterprise Virtualization Manager 3.5 进行了全新设置,则相关的访问权限会被默认设置。
  3. 重启 postgresql 服务:
    # service postgresql restart

过程 8.6. 第 3 步:配置新的 Data Warehouse 机器

  1. 运行 engine-setup 命令在机器上开始配置 Data Warehouse:
    # engine-setup
  2. Enter 配置 Data Warehouse:
    Configure Data Warehouse on this host (Yes, No) [Yes]:
  3. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  4. Enter 接受自动检测到的主机名,或输入一个其它主机名后点 Enter
    Host fully qualified DNS name of this server [autodetected host name]:
  5. 输入 ovirt_engine_history 数据库的以下位置信息:
    Where is the DWH database located? (Local, Remote) [Local]: Remote
    输入您的选择后点 Enter
  6. 输入 ovirt_engine_history 数据库主机的完全限定域名。点 Enter 接受每个项的默认值:
    DWH database host []: dwh-db-fqdn
    DWH database port [5432]: 
    DWH database secured connection (Yes, No) [No]: 
    DWH database name [ovirt_engine_history]: 
    DWH database user [ovirt_engine_history]: 
    DWH database password: password
  7. 输入 Manager 数据库所在机器的完全限定域名和密码。点 Enter 接受每个项的默认值:
    Engine database host []: engine-db-fqdn
    Engine database port [5432]: 
    Engine database secured connection (Yes, No) [No]: 
    Engine database name [engine]: 
    Engine database user [engine]: 
    Engine database password: password
  8. Enter 为已存在的 Data Warehouse 数据库创建一个备份:
    Would you like to backup the existing database before upgrading it? (Yes, No) [Yes]:
    创建备份所需的时间和存储空间取决于数据库的大小,它可能会需要几个小时来完成。备份文件的位置出现在设置脚本的后面。如果您在这一步没有选择备份数据库,当因为某些原因 engine-setup 运行失败,您将无法恢复数据库或其中的任何数据。
  9. 确认您将永久地把 Data Warehouse 服务与 Manager 断开:
    Do you want to permanently disconnect this DWH from the engine? (Yes, No) [No]:
  10. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:

过程 8.7. 第 4 步:在 Manager 的机器上删除 Data Warehouse 软件包

  1. 删除 Data Warehouse 软件包:
    # yum remove rhevm-dwh
    这一步会防止 Data Warehouse 服务在一个小时后自动重启。
  2. 删除 Data Warehouse 文件:
    # rm -rf /etc/ovirt-engine-dwh /var/lib/ovirt-engine-dwh
现在,Data Warehouse 服务和 Manager 被运行在不同的主机上。

8.5. 把 Reports 服务迁移到一个独立的机器上

把 Reports 服务从 Red Hat Enterprise Virtualization Manager 所在的机器迁移到一个专门的机器上。在一个独立的机器上运行 Reports 服务可以减少 Manager 所在机器的负载。请注意,这里所介绍的过程只迁移 Reports 服务,Reports 数据库(也被称为 ovirt_engine_reports 数据库)不能被迁移,您需要在新的机器上设置 Reports 时创建一个新的 ovirt_engine_reports 数据库。那些已被保存的、特设的(ad hoc)报表可以从 Manager 所在的机器迁移到新的 Reports 机器上。请只在配置完 Manager 和 Data Warehouse 后再迁移 Reports 服务。
安装这种配置包括 3 个关键的步骤:
  1. 配置新的 Reports 机器。
  2. 把已保存的报表迁移到新的 Reports 机器上。
  3. 从 Manager 所在的机器上删除 Reports 服务。
先决条件

请确认已经满足了以下先决条件:

  1. 已在同一台机器上安装并配置了 Manager 和 Reports。
  2. 已在 Manager 所在的机器上,或一台独立的机器上,安装并配置了 Data Warehouse。
  3. 为了设置新的 Reports 机器,您需要:
    • 安装了 Red Hat Enterprise Linux 6.6 或 6.7 的虚拟机或物理机
    • 订阅了 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 权利池
    • Data Warehouse 所在机器的 /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf 文件中的密码
    • 允许从 Reports 所在机器上访问 Manager 数据库所在机器的 TCP 端口 5432。

过程 8.8. 第 1 步:配置新的 Reports 机器

  1. 在 Content Delivery Network 中注册您的系统,在出现提示时输入您的 Customer Portal 用户名和密码:
    # subscription-manager register
  2. 找到 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池,并记录下它们的 ID。
    # subscription-manager list --available
  3. 使用前一步获得的池 ID 为系统附加权利:
    # subscription-manager attach --pool=pool_id
  4. 禁用所有存在的软件仓库:
    # subscription-manager repos --disable=*
  5. 启用所需的频道:
    # subscription-manager repos --enable=rhel-6-server-rpms
    # subscription-manager repos --enable=rhel-6-server-supplementary-rpms
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    # subscription-manager repos --enable=jb-eap-6-for-rhel-6-server-rpms
  6. 确认当前安装的软件包已被升级到最新版本:
    # yum update
  7. 安装 rhevm-reports-setup 软件包:
    # yum install rhevm-reports-setup
  8. 运行 engine-setup 命令在机器上开始配置 Reports:
    # engine-setup
  9. Enter 配置 Reports:
    Configure Reports on this host (Yes, No) [Yes]:
    
  10. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  11. Enter 接受自动检测到的主机名,或输入一个其它主机名后点 Enter
    Host fully qualified DNS name of this server [autodetected host name]:
  12. 输入 Manager 所在机器的完全限定域名并点 Enter
    Host fully qualified DNS name of the engine server []:
  13. 输入 ovirt_engine_reports 数据库的以下信息。点 Enter 来创建并配置一个本地数据库:
    Where is the Reports database located? (Local, Remote) [Local]:
    Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
  14. 输入 ovirt_engine_history 数据库主机的完全限定域名。点 Enter 接受每个项的默认值:
    DWH database host []: dwh-db-fqdn
    DWH database port [5432]: 
    DWH database secured connection (Yes, No) [No]: 
    DWH database name [ovirt_engine_history]: 
    DWH database user [ovirt_engine_history]: 
    DWH database password: password
  15. Enter 允许通过 SSH 在 Manager 上签发 Reports 证书和 Apache 证书:
    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]:
  16. Enter 接受默认的 SSH 端口,或输入另外一个端口号后点 Enter
    ssh port on remote engine server [22]:
  17. 输入 Manager 机器的 root 密码:
    root password on remote engine server manager-fqdn.com:
  18. Enter 允许在 Apache 上自动配置 SSL
    Setup can configure apache to use SSL using a certificate issued from the internal CA.
    Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
  19. 为 Reports 管理用户(adminsuperuser)设置一个密码。请注意,Reports 系统会有一组和 Manager 不同的用户验证信息:
    Reports power users password:
    您需要再次输入用户密码来确认它。
  20. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:

过程 8.9. 第 2 步:把保存的报表迁移到新的 Reports 机器上

  1. 在 Manager 机器上运行 ovirt-engine-reports-tool 命令:
    # ovirt-engine-reports-tool
  2. 输入相关导出域的编号并按 Enter:
    (2) Export Jasperreports saved reports to a zip file
    (1, 2, 3) []: 2
  3. 输入用来导出保存报告的 zip 文件的绝对路径,按 Enter
    Filename to export saved reports to: /tmp/saved-reports.zip
  4. 把 zip 文件复制到新的 Reports 的机器上:
    # scp /tmp/saved-reports.zip reports-machine-fqdn:/tmp/
  5. 在新的 Reports 机器上运行 ovirt-engine-reports-tool 命令:
    # ovirt-engine-reports-tool
  6. 输入相关导入域的编号并按 Enter:
    (3) Import a saved reports zip file to Jasperreports
    (1, 2, 3) []: 3
  7. 输入用于导入的 zip 文件的绝对路径,按 Enter
    Filename to import saved reports from: /tmp/saved-reports.zip
当命令运行完后,保存的报表会出现在新的 Reports 机器的 Reports 门户中。

过程 8.10. 第 3 步:从 Manager 机器上删除 Reports 服务

  1. 停止 Reports 服务:
    # service ovirt-engine-reportsd stop
  2. 删除 Reports 软件包:
    # yum remove rhevm-reports
  3. 删除 Reports 文件:
    # rm -rf /etc/ovirt-engine-reports /var/lib/ovirt-engine-reports
  4. 删除 Reports 数据库和用户。它们的默认名是 ovirt_engine_reports
    # su - postgres
    $ psql
    postgres=# drop database ovirt_engine_reports;
    postgres=# drop user ovirt_engine_reports;

注意

您可以配置多个 Reports 实例,并继续从一个较老的实例中登录并查看报表。但是,Manager 会直接连接到使用 engine-setup 配置的、最新的 Reports 实例上(并使用 SSO 的功能)。这意味着,管理门户只会包括最新安装的 Reports 的 dashboard。

第 9 章 Data Warehouse 和 Reports

9.1. 流程 - 设置数据收集机制并安装 Reports

9.2. 配置 Data Warehouse 和 Reports

Red Hat Enterprise Virtualization Manager 包括了一个功能强大的管理历史数据库,所有应用程序都可以从这个数据库中获取不同级别(数据中心、集群和主机)的信息。当安装 Data Warehouse(数据仓库)后,ovirt_engine_history 数据库会被创建,Manager 将使用这个数据库记录日志信息,并为报表服务提供数据。另外,Red Hat Enterprise Virtualization Manager Reports 作为一个可选的组件也包括在其中。Reports(报表)是 JasperServer 和 JasperReports(可以集成到 Java 应用程序中的开源报表工具) 的一个定制实现。它会产生报表,用户通过一个网络浏览器来访问,并可以把数据显示在显示器上、打印输出、输出为不同的格式(如 PDF、Excel、CSV、Word、RTF、Flash、ODTODS)。Data Warehouse 和 Reports 组件都是可选的,您需要单独安装并配置它们。
在安装 Data Warehouse 和 Reports 前,必须已经安装并配置了 Red Hat Enterprise Virtualization Manager。Reprots 所提供的功能依赖于 Data Warehouse,因此 Data Warehouse 必须在安装 Reports 前安装并配置。
我们推荐在 Data Warehouse/Reports 部署环境中的所有机器上使用 UTC 作为系统时区。这可以确保数据收集操作不会因为本地时区的改变(如夏时制)而受到影响。
使用 RHEV Manager History Database Size Calculator 工具程序可以估算 ovirt_engine_history 数据库需要使用的空间和资源。它是根据数据库中所包括的项的数量,以及数据需要被保存的时间来进行估算的。

9.3. 配置 Data Warehouse 和 Reports 的备注信息

行为

engine-setup 命令有以下行为:

安装 Data Warehouse 和 Reports 软件包并运行 engine-setup,在被提问是否配置 Data Warehouse 和 Reports 时回答 No
Configure Data Warehouse on this host (Yes, No) [Yes]: No
Configure Reports on this host (Yes, No) [Yes]: No
当再次运行 engine-setup 命令时,配置这些服务的选项将不再被显示。
临时解决方法

要强制 engine-setup 再次显示所有的选项,在运行 engine-setup 时使用以下选项:

# engine-setup --otopi-environment='OVESETUP_REPORTS_CORE/enable=none:None OVESETUP_DWH_CORE/enable=none:None'
如果只需要显示 Data Warehouse 的选项,运行:
# engine-setup --otopi-environment='OVESETUP_DWH_CORE/enable=none:None'
如果只需要显示 Reports 选项,运行:
# engine-setup --otopi-environment='OVESETUP_REPORTS_CORE/enable=none:None'

注意

如果只配置当前安装的 Data Warehouse 和 Reports 软件包,并且不需要从启用的软件仓库(repository)中更新软件包时,请使用 --offline 选项。

9.4. Data Warehouse 和 Reports 的安装选项

Data Warehouse 和 Reports 可以通过以下形式之一进行安装,根据您所选择的安装形式,它需要 1 到 3 台机器。
  1. 在安装 Manager 的机器上安装并配置 Data Warehouse 和 Reports。

    这个安装形式只需要一台机器,配置的过程也是最简单的。但是,这需要 3 个服务共享主机的 CPU 和内存,从而增加了对主机负载的要求。那些需要访问 Data Warehouse 或 Reports 服务的用户将需要访问 Manager 所在机器的权限。

  2. 在一台独立的机器上安装并配置 Data Warehouse 和 Reports。

    这种安装形式需要 2 台注册的主机,但可以减少对 Manager 所在机器的负载要求,并可以避免潜在的、因为共享 CPU 和内存可能产生的冲突。系统管理员可以只为用户分配访问 Data Warehouse 和 Reports 所在机器的权限,而不需要为他们分配访问 Manager 所在机器的权限。请注意,Data Warehouse 服务和 Reports 服务仍然需要共享它们所在机器的资源。

  3. 在一台独立的机器上安装并配置 Data Warehouse,然后在另外一台机器上安装 Reports 服务。

    这种安装形式需要 3 台注册的主机,但是每个服务都有独立的机器,这可以减少对每台机器的负载要求,并可以避免潜在的、因为共享 CPU 和内存可能产生的冲突。系统管理员可以根据需要只为用户分配访问特定机器的权限,而不需要为他们分配其它机器的权限。

  4. 在 Manager 所在的机器上安装和配置 Data Warehouse,然后在一台独立的机器上安装并配置 Reports 服务。

    这种安装形式需要 2 台注册的主机,但可以减少对 Manager 所在机器的负载要求,并可以避免潜在的、因为共享内存可能产生的冲突。系统管理员可以只为用户分配访问 Reports 所在机器的权限,而不需要为他们分配访问 Manager 所在机器的权限。

  5. 在一台独立的机器上安装并配置 Data Warehouse,然后在安装 Manager 的机器上安装 Reports 服务。

    这种安装形式需要 2 台注册的主机,但可以减少对 Manager 所在机器的负载要求,并可以避免潜在的、因为共享内存可能产生的冲突。系统管理员可以只为用户分配访问 Data Warehouse 所在机器的权限,而不需要为他们分配访问 Manager 所在机器的权限。

如果您选择在一台独立于安装 Data Warehouse 服务所在机器的系统上安装 Data Warehouse 数据库,您将需要额外的一台机器。这也适用于在独立的机器上安装 Reprots 数据库。

注意

与 JasperReports 相关的信息可以在 /usr/share/jasperreports-server-pro/docs/ 中获得。

9.4.1. 在运行 Red Hat Enterprise Virtualization Manager 的机器上安装 Data Warehouse 和 Reports

概述

在运行 Red Hat Enterprise Virtualization Manager 的机器上安装 Data Warehouse 和 Red Hat Enterprise Virtualization Manager Reports。

先决条件

请确认您已经满足了以下条件:

  1. 已在这台机器上安装并配置了 Manager。
  2. 如果选择使用远程的 Data Warehouse 数据库或 Reports 数据库,则需要在安装 Data Warehouse 和 Reports 服务前设置好数据库。您需要知道每个数据库主机的以下信息:
    • 主机的全局域名(FQDN)
    • 访问数据库的端口号(默认是 5432)
    • 数据库名
    • 数据库用户
    • 数据库密码
  3. 如果使用自承载引擎,则需要把它设为维护模式:
    # hosted-engine --set-maintenance --mode=global

过程 9.1. 在运行 Red Hat Enterprise Virtualization Manager 的机器上安装 Data Warehouse 和 Reports

  1. 在安装了 Red Hat Enterprise Virtualization Manager 的机器上安装 rhevm-dwh 软件包和 rhevm-reports 软件包:
    # yum install rhevm-dwh rhevm-reports
  2. 运行 engine-setup 命令在机器上开始配置 Data Warehouse 和 Reports:
    # engine-setup
  3. 根据提示配置 Data Warehouse 和 Reports:
    Configure Data Warehouse on this host (Yes, No) [Yes]: 
    Configure Reports on this host (Yes, No) [Yes]:
  4. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持当前的设置:
    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]:
    如果选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  5. 回答以下与 Data Warehouse database 和 Reports 数据库相关的问题:
    Where is the DWH database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: 
    Where is the Reports database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    Enter 使用默认值,或输入您所需要的值后点 Enter。如果选择 Remote,您将被提示输入每个远程数据库的信息。
  6. 为 Reports 管理用户(adminsuperuser)设置一个密码。请注意,Reports 系统会有一组和 Manager 不同的用户验证信息:
    Reports power users password:
    您需要再次输入用户密码来确认它们。
  7. 要使配置起作用,重启 ovirt-engine 服务。engine-setup 命令会提示:
    During execution engine service will be stopped (OK, Cancel) [OK]:
    Enter 继续。ovirt-engine 服务会在稍后被重启。
  8. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:
下一步

通过 http://demo.redhat.com/ovirt-engine-reports 访问报表门户(使用 Manager 的完全限定域名替换 demo.redhat.com)。如果在安装 Manager 时选择了非默认的 HTTP 端口,则需要在 URL 后面添加 :port(使用您选择的端口替换 :port)。

使用用户名 admin 和您在安装 Reports 时设置的密码进行登录。请注意,在第一次登录到 Red Hat Enterprise Virtualization Manager Reports 时,系统会自动生成一些网页,这会使第一次登录的时间比较长。

9.4.2. 在一个独立的机器上安装并配置 Data Warehouse 和 Reports

概述

在 Red Hat Enterprise Virtualization Manager 所在机器以外的一台机器上安装并配置 Data Warehouse 和 Red Hat Enterprise Virtualization Manager Reports。通过在一个独立的机器上安装 Data Warehouse和 Reports 服务,可以减少 Manager 所在机器的负载。请注意,在同一个机器上安装 Data Warehouse 和 Reports 意味着这些进程会共享 CPU 和内存。

先决条件

请确认已满足了以下条件:

  1. 已在另外一台机器上安装并配置了 Manager。
  2. 为了设置 Data Warehouse 和 Reports,需要:
    • 安装了 Red Hat Enterprise Linux 6.6 或 6.7 的虚拟机或物理机。
    • 订阅了 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池。
    • Manager 的 /etc/ovirt-engine/engine.conf.d/10-setup-database.conf 文件中的密码。.
    • 允许从 Data Warehouse 和 Reports 所在机器上访问 Manager 数据库所在机器的 TCP 端口 5432。
  3. 如果选择使用远程的 Data Warehouse 数据库或 Reports 数据库,则需要在安装 Data Warehouse 和 Reports 服务前设置好数据库。您需要知道每个数据库主机的以下信息:
    • 主机的全局域名(FQDN)
    • 访问数据库的端口号(默认是 5432)
    • 数据库名
    • 数据库用户
    • 数据库密码

过程 9.2. 在一个独立的机器上安装并配置 Data Warehouse 和 Reports

  1. 在 Content Delivery Network 中注册您的系统,在出现提示时输入您的 Customer Portal 用户名和密码:
    # subscription-manager register
  2. 找到 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池,并记录下它们的 ID。
    # subscription-manager list --available
  3. 使用前一步获得的池 ID 为系统附加权利:
    # subscription-manager attach --pool=pool_id
  4. 禁用所有存在的软件仓库:
    # subscription-manager repos --disable=*
  5. 启用所需的仓库:
    # subscription-manager repos --enable=rhel-6-server-rpms
    # subscription-manager repos --enable=rhel-6-server-supplementary-rpms
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    # subscription-manager repos --enable=jb-eap-6-for-rhel-6-server-rpms
  6. 确认当前安装的软件包已被升级到最新版本:
    # yum update
  7. 安装 rhevm-dwh-setuprhevm-reports-setup 软件包:
    # yum install rhevm-dwh-setup rhevm-reports-setup
  8. 运行 engine-setup 命令在机器上开始配置 Data Warehouse 和 Reports:
    # engine-setup
  9. 根据提示配置 Data Warehouse 和 Reports:
    Configure Data Warehouse on this host (Yes, No) [Yes]: 
    Configure Reports on this host (Yes, No) [Yes]:
  10. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  11. Enter 接受自动检测到的主机名,或输入一个其它主机名后点 Enter
    Host fully qualified DNS name of this server [autodetected hostname]:
  12. 输入 Manager 所在机器的完全限定域名并点 Enter
    Host fully qualified DNS name of the engine server []:
  13. 回答以下与 Data Warehouse 数据库和 Reports 数据库相关的问题:
    Where is the DWH database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: 
    Where is the Reports database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    Enter 使用默认值,或输入您所需要的值后点 Enter。如果选择 Remote,您将被提示输入每个远程数据库的信息。
  14. 输入 Manager 数据库所在机器的完全限定域名和密码。点 Enter 接受每个项的默认值:
    Engine database host []: engine-db-fqdn
    Engine database port [5432]: 
    Engine database secured connection (Yes, No) [No]: 
    Engine database name [engine]: 
    Engine database user [engine]: 
    Engine database password: password
  15. Enter 允许通过 SSH 在 Manager 上签发 Reports 证书和 Apache 证书:
    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]:
  16. Enter 接受默认的 SSH 端口,或输入另外一个端口号后点 Enter
    ssh port on remote engine server [22]:
  17. 输入 Manager 机器的 root 密码:
    root password on remote engine server manager-fqdn.com:
  18. Enter 允许在 Apache 上自动配置 SSL
    Setup can configure apache to use SSL using a certificate issued from the internal CA.
    Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
  19. 为 Reports 管理用户(adminsuperuser)设置一个密码。请注意,Reports 系统会有一组和 Manager 不同的用户验证信息:
    Reports power users password:
    您需要再次输入用户密码来确认它们。
  20. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:
下一步

通过 http://demo.redhat.com/ovirt-engine-reports 访问报表门户(使用 Manager 的完全限定域名替换 demo.redhat.com)。如果您在安装 Manager 时选择了非默认的 HTTP 端口,您需要在 URL 后面添加 :port(使用您选择的端口替换 :port)。

使用用户名 admin 和您在安装 Reports 时设置的密码进行登录。请注意,在第一次登录到 Red Hat Enterprise Virtualization Manager Reports 时,系统会自动生成一些网页,这会使第一次登录的时间比较长。

9.4.3. 在不同的机器上安装并配置 Data Warehouse 和 Reports

概述

在一个安装了 Red Hat Enterprise Virtualization Manager 的机器以外的机器上安装并配置 Data Warehouse,然后在第 3 台机器上安装 Red Hat Enterprise Virtualization Manager Reports。通过在独立的机器上安装 Data Warehouse 服务和 Reports 服务,可以减少 Manager 所在机器的负载。在不同的机器上分别安装 Data Warehouse 和 Reports 会进一步减少对每个服务所在主机的负载,并可以避免因为 CPU 和内存共享所造成的冲突。

安装这种配置包括两个关键的步骤:
  1. 在一个单独的机器上安装和配置 Data Warehouse。
  2. 在另外一个独立的机器上安装 Reports。
先决条件

请确认您已经满足了以下条件。

  1. 已在另外一台机器上安装并配置了 Manager。
  2. 为了设置 Data Warehouse,需要:
    • 安装了 Red Hat Enterprise Linux 6.6 或 6.7 的虚拟机或物理机。
    • 订阅了 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池。
    • Manager 的 /etc/ovirt-engine/engine.conf.d/10-setup-database.conf 文件中的密码。
    • 允许从 Data Warehouse 所在机器上访问 Manager 数据库所在机器的 TCP 端口 5432。
  3. 为了设置 Reports 所在的机器,需要:
    • 安装了 Red Hat Enterprise Linux 6.6 或 6.7 的虚拟机或物理机。
    • 订阅了 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池。
    • Data Warehouse 所在机器的 /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf 文件中的密码。
    • 允许从 Reports 所在机器上访问 Manager 数据库所在机器的 TCP 端口 5432。
  4. 如果选择使用远程的 Data Warehouse 数据库或 Reports 数据库,则需要在安装 Data Warehouse 和 Reports 服务前设置好数据库。您需要知道每个数据库主机的以下信息:
    • 主机的全局域名(FQDN)
    • 访问数据库的端口号(默认是 5432)
    • 数据库名
    • 数据库用户
    • 数据库密码

过程 9.3. 步骤 1:在一个独立的机器上安装和配置 Data Warehouse

  1. 在 Content Delivery Network 中注册您的系统,在出现提示时输入您的 Customer Portal 用户名和密码:
    # subscription-manager register
  2. 找到 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池,并记录下它们的 ID。
    # subscription-manager list --available
  3. 使用前一步获得的池 ID 为系统附加权利:
    # subscription-manager attach --pool=pool_id
  4. 禁用所有存在的软件仓库:
    # subscription-manager repos --disable=*
  5. 启用所需的仓库:
    # subscription-manager repos --enable=rhel-6-server-rpms
    # subscription-manager repos --enable=rhel-6-server-supplementary-rpms
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    # subscription-manager repos --enable=jb-eap-6-for-rhel-6-server-rpms
  6. 确认当前安装的软件包已被升级到最新版本:
    # yum update
  7. 安装 rhevm-dwh-setup 软件包:
    # yum install rhevm-dwh-setup
  8. 运行 engine-setup 命令在机器上开始配置 Data Warehouse:
    # engine-setup
  9. Enter 配置 Data Warehouse:
    Configure Data Warehouse on this host (Yes, No) [Yes]:
  10. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  11. Enter 接受自动检测到的主机名,或输入一个其它主机名后点 Enter
    Host fully qualified DNS name of this server [autodetected host name]:
  12. 回答以下与 Data Warehouse 数据库相关的问题:
    Where is the DWH database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
    Enter 使用默认值,或输入您所需要的值后点 Enter。如果选择 Remote,您将被提示输入每个远程数据库的信息。
  13. 输入 Manager 数据库所在机器的完全限定域名和密码。点 Enter 接受每个项的默认值:
    Engine database host []: engine-db-fqdn
    Engine database port [5432]: 
    Engine database secured connection (Yes, No) [No]: 
    Engine database name [engine]: 
    Engine database user [engine]: 
    Engine database password: password
  14. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:

过程 9.4. 步骤 2:在一个独立的机器上安装和配置 Reports

  1. 在 Content Delivery Network 中注册您的系统,在出现提示时输入您的 Customer Portal 用户名和密码:
    # subscription-manager register
  2. 找到包括安装 Reports 所需仓库的订阅池:
    # subscription-manager list --available | grep -A8 "Red Hat Enterprise Linux Server"
    # subscription-manager list --available | grep -A8 "Red Hat Enterprise Virtualization"
  3. 使用在上一步所获得的权利池 ID 把 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 的权利附加到系统上。运行以下命令:
    # subscription-manager attach --pool=pool_id
  4. 禁用所有存在的软件仓库:
    # subscription-manager repos --disable=*
  5. 启用所需的仓库:
    # subscription-manager repos --enable=rhel-6-server-rpms
    # subscription-manager repos --enable=rhel-6-server-supplementary-rpms
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    # subscription-manager repos --enable=jb-eap-6-for-rhel-6-server-rpms
  6. 确认当前安装的软件包已被升级到最新版本:
    # yum update
  7. 安装 rhevm-reports-setup 软件包:
    # yum install rhevm-reports-setup
  8. 运行 engine-setup 命令在机器上开始配置 Reports:
    # engine-setup
  9. Enter 配置 Reports:
    Configure Reports on this host (Yes, No) [Yes]:
    
  10. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  11. Enter 接受自动检测到的主机名,或输入一个其它主机名后点 Enter
    Host fully qualified DNS name of this server [autodetected host name]:
  12. 输入 Manager 所在机器的完全限定域名并点 Enter
    Host fully qualified DNS name of the engine server []:
  13. 回答以下与 Reports 数据库相关的问题:
    Where is the Reports database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
    Enter 使用默认值,或输入您所需要的值后点 Enter。如果选择 Remote,您将被提示输入每个远程数据库的信息。
  14. 输入 Data Warehouse 数据库所在机器的完全限定域名和密码。点 Enter 接受每个项的默认值:
    DWH database host []: dwh-db-fqdn
    DWH database port [5432]: 
    DWH database secured connection (Yes, No) [No]: 
    DWH database name [ovirt_engine_history]: 
    DWH database user [ovirt_engine_history]: 
    DWH database password: password
  15. Enter 允许通过 SSH 在 Manager 上签发 Reports 证书和 Apache 证书:
    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]:
  16. Enter 接受默认的 SSH 端口,或输入另外一个端口号后点 Enter
    ssh port on remote engine server [22]:
  17. 输入 Manager 机器的 root 密码:
    root password on remote engine server manager-fqdn.com:
  18. Enter 允许在 Apache 上自动配置 SSL
    Setup can configure apache to use SSL using a certificate issued from the internal CA.
    Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
  19. 为 Reports 管理用户(adminsuperuser)设置一个密码。请注意,Reports 系统会有一组和 Manager 不同的用户验证信息:
    Reports power users password:
    您需要再次输入用户密码来确认它们。
  20. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:
下一步

通过 http://demo.redhat.com/ovirt-engine-reports 访问报表门户(使用 Manager 的完全限定域名替换 demo.redhat.com)。如果您在安装 Manager 时选择了非默认的 HTTP 端口,您需要在 URL 后面添加 :port(使用您选择的端口替换 :port)。

使用用户名 admin 和您在安装 Reports 时设置的密码进行登录。请注意,在第一次登录到 Red Hat Enterprise Virtualization Manager Reports 时,系统会自动生成一些网页,这会使第一次登录的时间比较长。

9.4.4. 在运行 Red Hat Enterprise Virtualization Manager 的机器上安装 Data Warehouse,在另外的机器上安装 Reports

概述

在安装了 Red Hat Enterprise Virtualization Manager 的机器上安装 Data Warehouse,然后在另外一个机器上安装并配置 Red Hat Enterprise Virtualization Manager Reports。在独立的机器上运行 Reports 服务可以减少 Manager 所在机器的负载。

安装这种配置包括两个关键的步骤:
  1. 在安装 Manager 所在机器上安装和配置 Data Warehouse。
  2. 在另外一个独立的机器上安装 Reports。
先决条件

请确认您已经满足了以下条件。

  1. 已在一台机器上安装并配置了 Manager。您将会在这个机器上安装 Data Warehouse。
  2. 要设置 Reports 所在的机器,您需要:
    • 安装了 Red Hat Enterprise Linux 6.6 或 6.7 的虚拟机或物理机。
    • 订阅了 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 权利池。
    • Data Warehouse 所在机器的 /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf 文件中的密码。
    • 允许从 Reports 所在机器上访问 Manager 数据库所在机器的 TCP 端口 5432。
  3. 如果选择使用远程的 Data Warehouse 数据库或 Reports 数据库,则需要在安装 Data Warehouse 和 Reports 服务前设置好数据库。您需要知道每个数据库主机的以下信息:
    • 主机的全局域名(FQDN)
    • 访问数据库的端口号(默认是 5432)
    • 数据库名
    • 数据库用户
    • 数据库密码
  4. 如果您使用自承载引擎,则需要把它设为维护模式:
    # hosted-engine --set-maintenance --mode=global

过程 9.5. 步骤 1:在安装 Manager 的机器上安装和配置 Data Warehouse

  1. 安装 rhevm-dwh 软件包:
    # yum install rhevm-dwh
  2. 运行 engine-setup 命令在机器上开始配置 Data Warehouse:
    # engine-setup
  3. Enter 配置 Data Warehouse:
    Configure Data Warehouse on this host (Yes, No) [Yes]:
  4. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  5. 回答以下与 Data Warehouse 数据库相关的问题:
    Where is the DWH database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
    Enter 使用默认值,或输入您所需要的值后点 Enter。如果选择 Remote,您将被提示输入每个远程数据库的信息。
  6. 要使配置起作用,重启 ovirt-engine 服务。engine-setup 命令会提示您:
    During execution engine service will be stopped (OK, Cancel) [OK]:
    Enter 继续。ovirt-engine 服务会在稍后被重启。
  7. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:

过程 9.6. 步骤 2:在一个独立的机器上安装和配置 Reports

  1. 在 Content Delivery Network 中注册您的系统,在出现提示时输入您的 Customer Portal 用户名和密码:
    # subscription-manager register
  2. 找到 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池,并记录下它们的 ID。
    # subscription-manager list --available
  3. 使用前一步获得的池 ID 为系统附加权利:
    # subscription-manager attach --pool=pool_id
  4. 禁用所有存在的软件仓库:
    # subscription-manager repos --disable=*
  5. 启用所需的频道:
    # subscription-manager repos --enable=rhel-6-server-rpms
    # subscription-manager repos --enable=rhel-6-server-supplementary-rpms
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    # subscription-manager repos --enable=jb-eap-6-for-rhel-6-server-rpms
  6. 确认当前安装的软件包已被升级到最新版本:
    # yum update
  7. 安装 rhevm-reports-setup 软件包:
    # yum install rhevm-reports-setup
  8. 运行 engine-setup 命令在机器上开始配置 Reports:
    # engine-setup
  9. Enter 配置 Reports:
    Configure Reports on this host (Yes, No) [Yes]:
    
  10. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  11. Enter 接受自动检测到的主机名,或输入一个其它主机名后点 Enter
    Host fully qualified DNS name of this server [autodetected host name]:
  12. 输入 Manager 所在机器的完全限定域名并点 Enter
    Host fully qualified DNS name of the engine server []:
  13. 回答以下与 Reports 数据库相关的问题:
    Where is the Reports database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
    Enter 使用默认值,或输入您所需要的值后点 Enter。如果选择 Remote,您将被提示输入每个远程数据库的信息。
  14. 输入 Data Warehouse 数据库所在机器的完全限定域名和密码。点 Enter 接受每个项的默认值:
    DWH database host []: dwh-db-fqdn
    DWH database port [5432]: 
    DWH database secured connection (Yes, No) [No]: 
    DWH database name [ovirt_engine_history]: 
    DWH database user [ovirt_engine_history]: 
    DWH database password: password
  15. Enter 允许通过 SSH 在 Manager 上签发 Reports 证书和 Apache 证书:
    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]:
  16. Enter 接受默认的 SSH 端口,或输入另外一个端口号后点 Enter
    ssh port on remote engine server [22]:
  17. 输入 Manager 机器的 root 密码:
    root password on remote engine server manager-fqdn.com:
  18. Enter 允许在 Apache 上自动配置 SSL
    Setup can configure apache to use SSL using a certificate issued from the internal CA.
    Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
  19. 为 Reports 管理用户(adminsuperuser)设置一个密码。请注意,Reports 系统会有一组和 Manager 不同的用户验证信息:
    Reports power users password:
    您需要再次输入用户密码来确认它们。
  20. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:
下一步

通过 http://demo.redhat.com/ovirt-engine-reports 访问报表门户(使用 Manager 的完全限定域名替换 demo.redhat.com)。如果您在安装 Manager 时选择了非默认的 HTTP 端口,您需要在 URL 后面添加 :port(使用您选择的端口替换 :port)。

使用用户名 admin 和您在安装 Reports 时设置的密码进行登录。请注意,在第一次登录到 Red Hat Enterprise Virtualization Manager Reports 时,系统会自动生成一些网页,这会使第一次登录的时间比较长。

9.4.5. 在运行 Red Hat Enterprise Virtualization Manager 的机器上安装 Reports,在另外的机器上安装 Data Warehouse

概述

在一个安装了 Red Hat Enterprise Virtualization Manager 的机器以外的机器上安装并配置 Data Warehouse,然后在安装了 Red Hat Enterprise Virtualization Manager 的机器上安装 Reports。通过在一个独立的机器上安装 Data Warehouse,可以减少 Manager 所在机器的负载。请注意,在同一个机器上安装 Manager 和 Reports 意味着这些进程会共享 CPU 和内存。

安装这种配置包括两个关键的步骤:
  1. 在一个单独的机器上安装和配置 Data Warehouse。
  2. 在安装了 Manager 的机器上安装 Reports。
先决条件

请确认您已经满足了以下条件。

  1. 已在另外一台机器上安装并配置了 Manager。
  2. 为了设置 Data Warehouse,需要:
    • 安装了 Red Hat Enterprise Linux 6.6 或 6.7 的虚拟机或物理机。
    • 订阅了 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 权利池。
    • Manager 的 /etc/ovirt-engine/engine.conf.d/10-setup-database.conf 文件中的密码。.
    • 允许从 Data Warehouse 所在机器上访问 Manager 数据库所在机器的 TCP 端口 5432。
  3. 为了设置 Reports 所在的机器,需要:
    • Data Warehouse 所在机器的 /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf 文件中的密码。
  4. 如果选择使用远程的 Data Warehouse 数据库或 Reports 数据库,则需要在安装 Data Warehouse 和 Reports 服务前设置好数据库。您需要知道每个数据库主机的以下信息:
    • 主机的全局域名(FQDN)
    • 访问数据库的端口号(默认是 5432)
    • 数据库名
    • 数据库用户
    • 数据库密码
  5. 如果您使用自承载引擎,则需要把它设为维护模式:
    # hosted-engine --set-maintenance --mode=global

过程 9.7. 步骤 1:在一个独立的机器上安装和配置 Data Warehouse

  1. 在 Content Delivery Network 中注册您的系统,在出现提示时输入您的 Customer Portal 用户名和密码:
    # subscription-manager register
  2. 找到 Red Hat Enterprise Linux ServerRed Hat Enterprise Virtualization 订阅池,并记录下它们的 ID。
    # subscription-manager list --available
  3. 使用前一步获得的池 ID 为系统附加权利:
    # subscription-manager attach --pool=pool_id
  4. 禁用所有存在的软件仓库:
    # subscription-manager repos --disable=*
  5. 启用所需的频道:
    # subscription-manager repos --enable=rhel-6-server-rpms
    # subscription-manager repos --enable=rhel-6-server-supplementary-rpms
    # subscription-manager repos --enable=rhel-6-server-rhevm-3.6-rpms
    # subscription-manager repos --enable=jb-eap-6-for-rhel-6-server-rpms
  6. 确认当前安装的软件包已被升级到最新版本:
    # yum update
  7. 安装 rhevm-dwh-setup 软件包:
    # yum install rhevm-dwh-setup
  8. 运行 engine-setup 命令在机器上开始配置 Data Warehouse:
    # engine-setup
  9. Enter 配置 Data Warehouse:
    Configure Data Warehouse on this host (Yes, No) [Yes]:
  10. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  11. Enter 接受自动检测到的主机名,或输入一个其它主机名后点 Enter
    Host fully qualified DNS name of this server [autodetected host name]:
  12. 回答以下与 Data Warehouse 数据库相关的问题:
    Where is the DWH database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
    Enter 使用默认值,或输入您所需要的值后点 Enter。如果选择 Remote,您将被提示输入每个远程数据库的信息。
  13. 输入 Manager 数据库所在机器的完全限定域名和密码。点 Enter 接受每个项的默认值:
    Engine database host []: engine-db-fqdn
    Engine database port [5432]: 
    Engine database secured connection (Yes, No) [No]: 
    Engine database name [engine]: 
    Engine database user [engine]: 
    Engine database password: password
  14. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:

过程 9.8. 步骤 2:在安装了 Manager 的机器上安装和配置 Reprots

  1. 安装 rhevm-reports 软件包:
    # yum install rhevm-reports
  2. 运行 engine-setup 命令在机器上开始配置 Reports:
    # engine-setup
  3. Enter 配置 Reports:
    Configure Reports on this host (Yes, No) [Yes]:
    
  4. Enter 自动配置防火墙,或输入 No 并点 Enter 来保持存在的设置:
    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]:
    如果您选择了自动配置防火墙,但还没有激活的防火墙管理器,您将会被提示从一个列表中选择需要使用的防火墙管理器。输入防火墙管理器的名称后按 Enter
  5. 回答以下与 Reports 数据库相关的问题:
    Where is the Reports database located? (Local, Remote) [Local]: 
    Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.
    Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
    Enter 使用默认值,或输入您所需要的值后点 Enter。如果选择 Remote,您将被提示输入每个远程数据库的信息。
  6. 输入 Data Warehouse 数据库所在机器的完全限定域名和密码。点 Enter 接受每个项的默认值:
    DWH database host []: dwh-db-fqdn
    DWH database port [5432]: 
    DWH database secured connection (Yes, No) [No]: 
    DWH database name [ovirt_engine_history]: 
    DWH database user [ovirt_engine_history]: 
    DWH database password: password
  7. 为 Reports 管理用户(adminsuperuser)设置一个密码。请注意,Reports 系统会有一组和 Manager 不同的用户验证信息:
    Reports power users password:
    您需要再次输入用户密码来确认它们。
  8. 要使配置起作用,重启 ovirt-engine 服务。engine-setup 命令会提示您:
    During execution engine service will be stopped (OK, Cancel) [OK]:
    Enter 继续。ovirt-engine 服务会在稍后被重启。
  9. 确认您的安装设置:
    Please confirm installation settings (OK, Cancel) [OK]:
下一步

通过 http://demo.redhat.com/ovirt-engine-reports 访问报表门户(使用 Manager 的完全限定域名替换 demo.redhat.com)。如果您在安装 Manager 时选择了非默认的 HTTP 端口,您需要在 URL 后面添加 :port(使用您选择的端口替换 :port)。

使用用户名 admin 和您在安装 Reports 时设置的密码进行登录。请注意,在第一次登录到 Red Hat Enterprise Virtualization Manager Reports 时,系统会自动生成一些网页,这会使第一次登录的时间比较长。

附录 A. 手工安装 Manager 的操作系统

为了设置自承载环境中的 Manager 虚拟机,您可以选择手工安装 Manager 操作系统,或使用 RHEV-M Virtual Appliance 来简化安装的过程。以下介绍了手工安装的步骤。如需了解各种安装和配置 Manager 虚拟机方法间的不同,请参阅 附录 B, 不同 Manager 虚拟机设置流程的比较

过程 A.1. 手工安装 Manager 的操作系统

  1. 配置虚拟机

    hosted-engine 脚本会创建一个虚拟机,并把它配置为一个 Red Hat Enterprise Virtualization Manager(在这里被称为 HostedEngine-VM)。指定引导设备、安装媒体的路径名、CPU 类型、虚拟 CPU 的数量以及磁盘的大小。为 HostedEngine-VM 指定一个 MAC 地址,或使用系统自动创建的地址。在虚拟机安装操作系统前,可以使用这个 MAC 地址更新 DHCP 服务器。为 HostedEngine-VM 指定内存的大小,以及控制器连接类型。
    Please specify the device to boot the VM from (cdrom, disk, pxe) [cdrom]: 
    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 minimum requirement: 2]: 
    Please specify the disk size of the VM in GB [Defaults to minimum requirement: 25]: 
    You may specify a MAC address for the VM or accept a randomly generated default [00:16:3e:77:b2:a4]: 
    Please specify the memory size of the VM in MB [Defaults to minimum requirement: 4096]: 
    Please specify the console type you want to use to connect to the VM (vnc, spice) [vnc]:
  2. 配置自承载引擎

    指定在 Red Hat Enterprise Virtualization 环境中标识自承载引擎主机的名称,以及访问管理门户所使用的 admin@internal 用户的密码。提供 HostedEngine-VM 的 FQDN(在这里我们使用 Manager.example.com 作为 FQDN)。最后,提供 SMTP 的名称和 TCP 端口号、发送事件通知的电子邮件地址、以及需要接收事件通知的用户的电子邮件地址列表(以逗号分隔)。
    Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]: Host-HE1
    Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: 
    Confirm 'admin@internal' user password: 
    Please provide the FQDN for the engine you want to use. This needs to match the FQDN that you will use for the engine installation within the VM: manager.example.com
    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]:
  3. 配置预览

    在实际进行配置前,hosted-engine 脚本会显示已输入的信息,并提示您确认这些信息。
    Bridge interface                   : eth1
    Engine FQDN                        : manager.example.com
    Bridge name                        : rhevm
    SSH daemon port                    : 22
    Firewall manager                   : iptables
    Gateway address                    : X.X.X.X
    Host name for web application      : Host-HE1
    Host ID                            : 1
    Image size GB                      : 25
    Storage connection                 : storage.example.com:/hosted_engine/nfs
    Console type                       : vnc
    Memory size MB                     : 4096
    MAC address                        : 00:16:3e:77:b2:a4
    Boot type                          : pxe
    Number of CPUs                     : 2
    CPU Type                           : model_Penryn
    
    Please confirm installation settings (Yes, No)[Yes]:
  4. 配置 HostedEngine-VM

    这个脚本会创建虚拟机 HostedEngine-VM,并提供和它进行连接的详情信息。您需要在 HostedEngine-VM 上安装一个操作系统后才能继续在 Host-HE1 上执行 hosted-engine 脚本。
    [ INFO  ] Stage: Transaction setup
    ...
    [ INFO  ] Creating VM
    You can now connect to the VM with the following command:
    	/usr/bin/remote-viewer vnc://localhost:5900
    Use temporary password "5379skAb" 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 console using the following command:
    virsh -c qemu+tls://Test/system console HostedEngine
    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
    The VM has been started.  Install the OS and shut down or reboot it.  To continue please make a selection:
             
              (1) Continue setup - VM installation is complete
              (2) Reboot the VM and restart installation
              (3) Abort setup
              (4) Destroy VM and abort setup
             
              (1, 2, 3, 4)[1]:
    运行以下命令使用 VNC 协议连接到虚拟机。使用 Host-HE1 的 FQDN 或 IP 地址替换 FQDN
    /usr/bin/remote-viewer vnc://FQDN:5900
  5. 安装虚拟机操作系统

    连接到 hosted-engine 脚本所创建的虚拟机(HostedEngine-VM),安装 Red Hat Enterprise Linux 6.7 操作系统。
  6. 同步主机和虚拟机

    返回到 Host-HE1,选择选项 1 来继续 hosted-engine 脚本:
    (1) Continue setup - VM installation is complete
  7. 安装 Manager

    连接到 HostedEngine-VM,订阅相关的 Red Hat Enterprise Virtualization Manager 仓库(repository)。详情请参阅 订阅所需的权利
    确认所有安装的软件包都是最新版本,并安装了 rhevm 软件包。
    # yum update
    # yum install rhevm
  8. 配置 HostedEngine-VM

    在 HostedEngine-VM 上配置引擎。
    # engine-setup
    [ INFO  ] Stage: Initializing
    [ INFO  ] Stage: Environment setup
    Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']
    Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20140304075238.log
    Version: otopi-1.1.2 (otopi-1.1.2-1.el6ev)
    [ INFO  ] Stage: Environment packages setup
    [ INFO  ] Yum Downloading: rhel-65-zstream/primary_db 2.8 M(70%)
    [ INFO  ] Stage: Programs detection
    [ INFO  ] Stage: Environment setup
    [ INFO  ] Stage: Environment customization
             
              --== PACKAGES ==--
             
    [ INFO  ] Checking for product updates...
    [ INFO  ] No product updates found
             
              --== NETWORK CONFIGURATION ==--
             
    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]: 
    [ INFO  ] iptables will be configured as firewall manager.
             
              --== DATABASE CONFIGURATION ==--
             
             
              --== OVIRT ENGINE CONFIGURATION ==--
             
              Skipping storing options as database already prepared
             
              --== PKI CONFIGURATION ==--
             
              PKI is already configured
             
              --== APACHE CONFIGURATION ==--
             
             
              --== SYSTEM CONFIGURATION ==--
             
             
              --== END OF CONFIGURATION ==--
             
    [ INFO  ] Stage: Setup validation
    [ INFO  ] Cleaning stale zombie tasks
             
              --== CONFIGURATION PREVIEW ==--
             
              Database name                      : engine
              Database secured connection        : False
              Database host                      : X.X.X.X
              Database user name                 : engine
              Database host name validation      : False
              Database port                      : 5432
              NFS setup                          : True
              Firewall manager                   : iptables
              Update Firewall                    : True
              Configure WebSocket Proxy          : True
              Host FQDN                          : manager.example.com
              NFS mount point                    : /var/lib/exports/iso
              Set application as default page    : True
              Configure Apache SSL               : True
             
              Please confirm installation settings (OK, Cancel) [OK]:
    确定设置。完成后,系统会提供一个 SSH 指纹(fingerprint)和一个内部的证书授权哈希数据(Certificate Authority hash)。
  9. 把主机和 Manager 进行同步

    返回到 Host-HE1,选择选项 1 来继续 hosted-engine 脚本:
    (1) Continue setup - engine installation is complete
    [ INFO  ] Engine replied: DB Up!Welcome to Health Status!
    [ 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
              Please shutdown the VM allowing the system to launch it as a monitored service.
              The system will wait until the VM is down.
  10. 关闭 HostedEngine-VM

    关闭 HostedEngine-VM。
    # shutdown -h now
  11. 设置确认

    返回到 Host-HE1,确认它检测到 HostedEngine-VM 已经被关闭。
    [ INFO  ] Enabling and starting HA services
              Hosted Engine successfully set up
    [ INFO  ] Stage: Clean up
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination

附录 B. 不同 Manager 虚拟机设置流程的比较

使用 RHEV-M Virtual Appliance 自动化安装和配置 Manager 虚拟机的过程。
手工安装和配置 Manager 虚拟机同样被支持,但需要在设置的过程中直接访问虚拟机。

附录 C. 修订历史

修订历史
修订 3.6-7.1Thu Mar 3 2016Red Hat Localization Services
与 XML 源 3.6-7 版本同步的翻译文件
修订 3.6-7Thur 11 Feb 2016Red Hat Enterprise Virtualization Documentation Team
BZ#1301411 - 添加了安装流程的图示。
修订 3.6-6.1Fri Jan 29 2016Red Hat Localization Services
与 XML 源 3.6-6 版本同步的翻译文件
修订 3.6-6Wed 27 Jan 2016Red Hat Enterprise Virtualization Documentation Team
BZ#1279930 - 删除了与 rhel-7-server-optional-rpms 和 rhel-7-server-supplementary-rpms 频道相关的信息。
BZ#1293623 - 更新了升级章节中与 repos 相关的信息。
BZ#1151265 - 添加了一个新章节:“从自承载引擎环境中删除主机”。
BZ#1288672 - 添加了一个警告注释:当前还不支持配置绑定网络接口和 vlan-tagged 网络接口。
修订 3.6-5Wed 23 Dec 2015Red Hat Enterprise Virtualization Documentation Team
BZ#1283796 - 更新了自承载引擎安装的步骤来包括手工安装 Manager 的步骤,并明确了使用 RHEV-M Virtual Appliance 是一个可选的操作。
修订 3.6-4Tue 08 Dec 2015Red Hat Enterprise Virtualization Documentation Team
BZ#1275504 - 修改了“迁移到自承载环境”的标题。
BZ#1285598 - 增加了“把自承载引擎数据库迁移到远程服务器数据库”的内容。
BZ#1218312 - 添加了一个提示信息:在默认情况下,SSH 密码验证不会被启用。并增加了启用它的方法。
修订 3.6-3Wed 18 Nov 2015Red Hat Enterprise Virtualization Documentation Team
Red Hat Enterprise Virtualization 3.6 beta 版。
修订 3.6-2Wed 18 Nov 2015Red Hat Enterprise Virtualization Documentation Team
BZ#1255231 - 更新了使用引擎 appliance 部署自承载引擎的信息。
BZ#1279930 - 把 'rhel-7-server-optional-rpms' 添加到必需的 repo 中。
BZ#1200649 - 修改了文章的一些风格。
BZ#1281642 - 增加了在订阅到池 ID 后禁用仓库的步骤。
修订 3.6-1Mon 31 Aug 2015Red Hat Enterprise Virtualization Documentation Team
为 Red Hat Enterprise Virtualization 3.6初始创建。

法律通告

Copyright © 2016 Red Hat.
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.