第 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]:
    
在用户确认所输入的信息后,脚本会完成主机安装的操作,并把它加入到环境中。