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 的自承载引擎
初始化引擎
运行hosted-engine脚本。推荐使用screen来运行这个脚本。这可以防止,在出现网络问题或终端被非正常终止时丢失当前运行的任务。screen 软件包包括在标准的 Red Hat Enterprise Linux 软件仓库中,安装这个软件包后就可以使用这个工具程序。使用 CTRL+D 键组合可以随时终止脚本。yum install screen
# yum install screenCopy to Clipboard Copied! Toggle word wrap Toggle overflow screen hosted-engine --deploy
# screen hosted-engine --deployCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注意
当网络中断或超时时,可以运行screen -d -r来恢复当前运行的hosted-engine。配置存储
选择使用的存储类型。During customization use CTRL-D to abort. Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs3, nfs4)[nfs3]:
During customization use CTRL-D to abort. Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs3, nfs4)[nfs3]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 对于 NFS 存储类型,使用 FQDN 或 IP 地址指定它的完整地址,以及共享存储域的路径名。
Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/nfs
Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/nfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 对于 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]:
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]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 对于 Gluster 存储类型,使用 FQDN 或 IP 地址指定它的完整地址,以及共享存储域的路径名。
重要
当前只支持 3 个 Gluster 存储副本(replica)。请确认已进行了以下配置:- 在所有 3 个 Gluster 服务器的
/etc/glusterfs/glusterd.vol文件中,把rpc-auth-allow-insecure设置为on。option rpc-auth-allow-insecure on
option rpc-auth-allow-insecure onCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 对卷进行以下配置:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/gluster_volume
Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/gluster_volumeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 对于光纤通道设备,主机的总线适配器需要被配置和连接,
hosted-engine脚本会自动检测到有效的 LUN。LUN 不能包括任何额外的数据。Copy to Clipboard Copied! Toggle word wrap Toggle overflow
选择环境中使用的存储域和存储数据中心名。[ 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]:
[ 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]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 配置网络
这个脚本会检测可以被用来作为环境的管理网桥的网卡(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]:
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]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 配置虚拟机
注意
如需手工安装 Manager 虚拟机,请参阅 附录 A, 手工安装 Manager 的操作系统。使用 appliance,可以简化安装过程,而使用手工安装的方法,可以对安装过程进行完全的控制。选择 作为引导设备类型,脚本会自动检测到可用的 RHEV-M Appliances。指定内存的大小。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果使用 cloud-init 对 Manager 虚拟机进行初始设置,则选Yes。选择 来使用 cloud-init 进行配置,如设置 root 密码、配置网络、配置主机名、为engine-setup提供使用的应答文件、在引导时运行engine-setup。另外,如果已有存在的 cloud-init 脚本,则可以选择 来使用这个脚本。指定 Manager 虚拟机的 FQDN。为 HostedEngine-VM 指定一个 MAC 地址,或使用随机推荐的地址。您可以在虚拟机安装操作系统前,使用这个 MAC 地址更新您的 DHCP 和 DNS 服务器。注意
如需了解更多与 cloud-init 相关的信息,请参阅 https://cloudinit.readthedocs.org/en/latest/。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 配置引擎
指定在管理门户中标识 hypervisor 主机的名称,以及访问管理门户所使用的admin@internal用户的密码。提供 HostedEngine-VM 的 FQDN(在这里我们使用 Manager.example.com 作为 FQDN)。为 SMTP 服务器提供名称和 TCP 端口号、发送事件通知的电子邮件地址、以及需要接收事件通知的用户的电子邮件地址列表(以逗号分隔)。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 配置预览
在实际进行配置前,hosted-engine脚本会显示已输入的信息,并提示您确认这些信息。配置 Manager 虚拟机
这个脚本将创建 Manager 虚拟机,启动ovirt-engine和高可用性服务,并把 hypervisor 主机和共享存储域连接到 Manager 虚拟机。Copy to Clipboard Copied! Toggle word wrap Toggle overflow
当
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:
PasswordAuthenticationPermitRootLogin
重启
sshd 服务来使所做的修改生效。