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 虚拟机,以及当前正在其它主机上运行的虚拟机。