Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

6.2. 恢复自托管引擎环境

本节介绍如何从新安装的主机上的备份中恢复自托管引擎环境。支持的恢复方法使用 engine-backup 工具。
恢复自托管引擎环境涉及以下关键操作:
  1. 创建新安装的 Red Hat Enterprise Linux 主机并运行 hosted-engine 部署脚本。
  2. 在新 Manager 虚拟机中恢复 Red Hat Virtualization Manager 配置设置和数据库内容。
  3. 删除处于 Non Operational 状态的自托管引擎节点,并将其重新安装到恢复的自托管引擎环境中。

前提条件

  • 要恢复自托管引擎环境,您必须在物理主机上准备新安装的 Red Hat Enterprise Linux 系统。
  • 新主机和管理器的操作系统版本必须与原始主机和管理器的相同。
  • 您必须有适用于您新环境的红帽订阅管理器权利。有关所需存储库的列表 ,请参阅安装指南中的订阅所需 权利
  • 新管理器的完全限定域名必须与原始 Manager 的完全限定域名相同。正向和反向查找记录必须在 DNS 中设置。
  • 您必须为新的自托管引擎环境准备存储,以用作管理器虚拟机的共享存储域。此域必须至少为 60 GB。有关为您的部署准备存储的更多信息,请参阅管理指南中的存储章节https://access.redhat.com/documentation/en/red-hat-virtualization/4.0/single/administration-guide/#chap-Storage

6.2.1. 创建新的自托管引擎环境,用作恢复的环境

您可以在备份环境中使用的硬件上恢复自托管引擎。但是,您必须将故障转移主机用于恢复的部署。第 6.1 节 “备份自托管引擎管理器虚拟机” 中使用的故障转移 主机 (主机 1)使用 hosted_engine_1 的默认主机名,该主机名也在此流程中使用。 由于自托管引擎的恢复过程的性质,可以在恢复引擎的最终同步前发生,需要删除此故障转移主机,只有在执行备份时主机没有虚拟负载时才实现。您还可以在备份环境中不使用的独立硬件上恢复备份,这并不是一个问题。
重要
此流程假设您在物理主机上安装了 Red Hat Enterprise Linux 系统,已将主机订阅到所需权利,并安装了 ovirt-hosted-engine-setup 软件包。如需更多信息,请参阅安装指南中的订阅 所需 权利和 第 2.1.1 节 “安装自托管引擎软件包”

过程 6.4. 创建新的自托管环境,用作恢复的环境

  1. 更新 DNS

    更新您的 DNS,以便 Red Hat Virtualization 环境的完全限定域名与新管理器的 IP 地址相关联。在此过程中,完全限定域名被设置为 Manager.example.com。为引擎提供的完全限定域名必须与备份的原始引擎引擎设置中给出的相同。
  2. 启动托管引擎部署

    在新安装的 Red Hat Enterprise Linux 主机上,运行 hosted-engine 部署脚本。要随时退出脚本,请使用 CTRL+D 键盘组合来中止部署。如果通过网络运行 hosted-engine 部署脚本,建议使用 screen 窗口管理器以避免在网络或终端中断时丢失会话。如果尚未安装,则首先安装 screen 软件包。
    # screen
    # hosted-engine --deploy
  3. 准备初始化

    脚本首先请求确认,以使用主机作为虚拟机监控程序在自托管引擎环境中使用。
    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 (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 存储。确保已进行以下配置:
      • 在所有三个 Gluster 服务器上的 /etc/glusterfs/glusterd.vol 文件中,将 rpc-auth-allow-insecure 设置为 上的
        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]:
  5. 配置网络

    该脚本检测可能的网络接口控制器(NIC),以用作环境的管理网桥。然后,它会检查您的防火墙配置,并提供了修改控制台(SPICE 或 VNC)以访问 Manager 虚拟机。提供可供 ovirt-ha-agent 使用的可 ping 网关 IP 地址,以帮助确定主机是否适合运行 Manager 虚拟机。
    Please indicate a nic to set ovirtmgmt 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. 配置新管理器虚拟机

    该脚本将创建要配置为新管理器虚拟机的虚拟机。指定引导设备,如果适用,安装媒体的路径名称、镜像别名、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. 识别主机名

    指定 admin@internal 用户的密码来访问管理门户。
    必须为主机名提供唯一名称,以确保它不与从备份中恢复引擎时存在的其他资源冲突。此流程中可以使用名称 hosted_engine_1,因为此主机在环境备份前被置于维护模式,从而在引擎恢复引擎和主机和引擎的最终同步之间删除此主机。
    Enter engine admin password: 
    Confirm engine admin password:
    Enter the name which will be used to identify this host inside the Administration Portal [hosted_engine_1]:
  8. 配置托管引擎

    为新 Manager 虚拟机提供完全限定域名。此流程使用完全限定域名 Manager.example.com。提供 SMTP 服务器的名称和 TCP 端口号、用于发送电子邮件通知的电子邮件地址,以及用于接收这些通知的电子邮件地址列表。
    重要
    为引擎(Manager.example.com)提供的完全限定域名必须与最初设置原始管理器时提供的完全限定域名相同。
    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                        : ovirtmgmt
    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. 创建新管理器虚拟机

    该脚本创建虚拟机以配置为管理器虚拟机,并提供连接详情。您必须在其上安装操作系统,然后 hosted-engine 部署脚本可以在 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 7 操作系统。
  12. 同步主机和管理器

    返回到主机,并通过选择选项 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 虚拟机,在 Red Hat Subscription Management 中注册,并启用所需的存储库。请参阅安装指南中的订阅所需 权利
    确保所有已安装软件包的最新版本都正在使用,并安装 rhevm 软件包。
    # yum update
    注意
    如果任何与内核相关的软件包已更新,请重新启动计算机。
    # yum install rhevm
软件包安装完成后,您将能够继续恢复自托管引擎管理器。