自承载引擎指南
第 1 章 介绍
表 1.1. 支持部署自承载引擎的操作系统版本
|
系统类型
|
支持的版本
|
|---|---|
|
Red Hat Enterprise Linux 主机
|
7.2
|
|
Red Hat Virtualization Host
|
7.2
|
|
HostedEngine-VM (Manager)
|
7
|
重要

第 2 章 部署自承载引擎
2.1. 在 Red Hat Enterprise Linux 主机上部署自承载引擎
2.1.1. 安装自承载引擎软件包
过程 2.1. 安装自承载引擎
- 安装自承载引擎软件包
# yum install ovirt-hosted-engine-setup
- 如果选择使用 appliance 来安装 Manager 虚拟机,则需要安装 RHV-M Virtual Appliance 软件包:
# yum install rhevm-appliance
您也可以使用 CD-ROM、磁盘或 PXE 安装 Manager 的操作系统。物理的 CD-ROM 驱动设备不被支持。
2.1.2. 配置基于 RHEL 的自承载引擎
hosted-engine 脚本可以帮助进行主机和 Manager 虚拟机的配置。这个脚本会要求您回答一系列问题,然后根据提供的信息对系统进行配置。
先决条件
- 已经安装了一个全新的 Red Hat Enterprise Linux 7 系统,并在其中安装了 ovirt-hosted-engine-setup 软件包。
- 为自承载引擎环境设置了存储系统。如需了解更多与存储相关的信息,请参阅 Red Hat Enterprise Virtualization 管理指南中的存储一章。
- 设置了 Manager 和主机的完全限定域名(FQDN)。DNS 中需要有它的正向和反向查询记录。
- 需要具有为 Manger 安装操作系统所需的安装介质(CD-ROM、磁盘或 PXE)。推荐的方法是选择磁盘选项,并使用RHV-M Virtual Appliance 安装 Manager。在安装 rhevm-appliance 软件包后,就可以使用 RHV-M Virtual Appliance。如果选择使用 CD-ROM 选项,则需要使用一个 ISO 文件。物理的 CD-ROM 驱动设备不被支持。
- 如果使用 RHV-M Virtual Appliance 安装 Manager,需要保证一个目录有最少 60 GB 空间。
hosted-engine脚本会首先检查/var/tmp是否有足够的空间来展开 appliance 文件。如果空间不够,则需要指定一个不同的目录。
过程 2.2. 配置基于 RHEL 的自承载引擎
初始化引擎
运行hosted-engine脚本。使用 CTRL+D 可以随时中断部署。我们推荐在运行脚本时使用screen程序,这样可以避免因为网络中断或其它原因造成脚本运行被中断。screen 软件包包括在标准的 Red Hat Enterprise Linux 软件仓库中。# yum install screen
# screen
# hosted-engine --deploy
注意
当网络中断或超时时,可以运行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]:
- 对于 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 地址指定它的完整地址,以及共享存储域的路径名。
重要
当前只支持 replica 3 Gluster 存储。请确认已进行了以下配置:- 在所有 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]:
配置网络
这个脚本会检测可以被用来作为环境的管理网桥的网卡(NIC),然后会检查防火墙的配置,并为控制台(SPICE 或 VNC)访问修改防火墙的配置。Please indicate a nic to set rhvm 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]:
配置虚拟机
选择 作为引导设备类型,脚本会自动检测到可用的 RHV-M Appliances。指定内存的大小。Please specify the device to boot the VM from (choose disk for the oVirt engine appliance) (cdrom, disk, pxe) [disk]: Please specify the console type you would like to use to connect to the VM (vnc, spice) [vnc]: vnc [ 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)如果使用 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/。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 ISO image (of no-cloud type) 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 Enter root password that will be used for the engine appliance (leave it empty to skip): p@ssw0rd Confirm appliance root password: p@ssw0rd 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]: 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配置引擎
指定在管理门户中代表主机的名称,以及访问管理门户所使用的admin@internal用户的密码。提供 HostedEngine-VM 的 FQDN(在这里我们使用 Manager.example.com 作为 FQDN)。为 SMTP 服务器提供名称和 TCP 端口号、发送事件通知的电子邮件地址、以及需要接收事件通知的用户的电子邮件地址列表(以逗号分隔)。Enter engine admin password: p@ssw0rd Confirm engine admin password: p@ssw0rd Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]: 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]:配置预览
在实际进行配置前,hosted-engine脚本会显示已输入的信息,并提示您确认这些信息。配置 Manager 虚拟机
这个脚本将创建 Manager 虚拟机,启动ovirt-engine和高可用性服务,并把主机和共享存储域连接到 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 configuration 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 Virtualization Manager 就已经被配置完成,并在您的主机上运行。Manager 已经配置好了数据中心、集群、主机、Manager 虚拟机,以及 Manager 虚拟机专用的共享存储域。
重要
ovirt-engine-extension-aaa-ldap-setup 设置脚本在您的环境中添加目录服务器。如需了解更多相关信息,请参阅管理指南中的 Configuring an External LDAP Provider。
ovirt-hosted-engine-setup 脚本同时也会把您在配置过程中提供的信息保存为一个应答文件,您可以使用它来进行系统恢复。如果没有使用 --generate-answer=<file> 参数指定应答文件,它会被默认存为 /etc/ovirt-hosted-engine/answers.conf。
注意
sshd 服务正在运行。编辑 /etc/ssh/sshd_config,把以下两个选项设置为 yes:
PasswordAuthenticationPermitRootLogin
sshd 服务来使所做的修改生效。
2.2. 在 Red Hat Virtualization Host上部署自承载引擎
hosted-engine 脚本的一个 UI 版本,可以帮助进行主机和 Manager 虚拟机的配置。这个脚本会要求您回答一系列问题,然后根据提供的信息对系统进行配置。
先决条件
- 一个全新安装的 Red Hat Virtualization Host 系统。Cockpit 用户接口中的 System 子标签页中的 Performance Profile 需要被设置为
virtual-host。 - 为自承载引擎环境设置了存储系统。如需了解更多与存储相关的信息,请参阅 Red Hat Enterprise Virtualization 管理指南中的存储一章。
- 设置了 Manager 和主机的完全限定域名(FQDN)。DNS 中需要有它的正向和反向查询记录。
- 如果使用 RHV-M Virtual Appliance 安装 Manager,需要保证一个目录有最少 60 GB 空间。
hosted-engine脚本会首先检查/var/tmp是否有足够的空间来展开 appliance 文件。如果空间不够,则需要指定一个不同的目录。
过程 2.3. 配置基于 RHVH 的自承载引擎
获得 RHV-M Virtual Appliance
从客户门户网站下载 RHV-M Virtual Appliance:- 登录到客户门户网站 https://access.redhat.com。
- 点菜单条中的下载。
- 点 Red Hat Enterprise Virtualization > 来访问产品的下载页。
- 从所需版本的 Red Hat Virtualization 中选择 appliance,点 。
把 OVA 文件复制到 Red Hat Virtualization Host:scp rhvm-appliance.ova root@host.example.com:/usr/share
开始自承载引擎部署
登录到 Cockpit 用户界面(https://HostIPorFQDN:9090)。进入 Virtualization > Hosted Engine,点 。
如果存在,默认的回答信息会自动在部署脚本的文本项中生成。您可以根据需要对它进行相应的修改。
注意
在这个过程中,部署的问题会以文本的形式出现。在 UI 中点 。During customization use CTRL-D to abort. Continuing will configure this host for serving as hypervisor and create a VM where you have to install the engine afterwards. Are you sure you want to continue? (Yes, No)[Yes]:
配置存储
选择使用的存储类型。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 地址指定它的完整地址,以及共享存储域的路径名。
重要
当前只支持 replica 3 Gluster 存储。请确认已进行了以下配置:- 在所有 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]:
配置网络
脚本会检查防火墙配置,并为控制台(SPICE 或 VNC)进行相应的修改。然后,它会检测可以作为环境的管理网桥的网络接口控制器(NIC)。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 ovirtmgmt bridge on: (eth1, eth0) [eth1]:
配置虚拟机
从引导设备类型中选 ,然后指定到 RHV-M Virtual Appliance 的路径。如果/var/tmp目录没有足够的空间,则指定另外一个目录。Please specify the device to boot the VM from (choose disk for the oVirt engine appliance) (cdrom, disk, pxe) [disk]: disk
Please specify the console type you would like to use to connect to the VM (vnc, spice) [vnc]: vnc
Using an oVirt engine appliance could greatly speed-up ovirt hosted-engine deploy. You could get oVirt engine appliance installing ovirt-engine-appliance rpm. Please specify path to OVF archive you would like to use [None]: /path/to/rhvm-appliance.ova
Please specify path to a temporary directory with at least 50 GB [/var/tmp]:
如果使用 cloud-init 对 Manager 虚拟机进行初始设置,则选 。选择 来使用 cloud-init 进行配置,如设置 root 密码、配置网络、配置主机名、为engine-setup提供使用的应答文件、在引导时运行engine-setup。另外,如果已有存在的 cloud-init 脚本,则可以选择 来使用这个脚本实现 cloud-init 更复杂的功能。注意
如需了解更多与 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 ISO image (of no-cloud type) 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: [localdomain] 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
The following CPU types are supported by this host: - model_SandyBridge: Intel SandyBridge Family - model_Westmere: Intel Westmere Family - model_Nehalem: Intel Nehalem Family - model_Penryn: Intel Penryn Family - model_Conroe: Intel Conroe Family Please specify the CPU type to be used by the VM [model_SandyBridge]:Please specify the number of virtual CPUs for the VM [Defaults to appliance OVF value: [2]:
You may specify a unicast 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 maximum available): [12722]:
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 (max 3) of IP addresses of domain name servers for the engine VM Engine VM DNS (leave it empty to skip):
如果需要把/etc/hosts文件从主机复制到 Manager 虚拟机以实现主机域名解析的功能,输入Yes。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
配置自承载引擎
指定在管理门户中代表主机的名称,以及访问管理门户所使用的admin@internal用户的密码。提供 HostedEngine-VM 的 FQDN(在这里我们使用 Manager.example.com 作为 FQDN)。为 SMTP 服务器提供名称和 TCP 端口号、发送事件通知的电子邮件地址、以及需要接收事件通知的用户的电子邮件地址列表(以逗号分隔)。Enter engine admin password: p@ssw0rd
Confirm engine admin password: p@ssw0rd
Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]:
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]:
配置预览
在实际进行配置前,hosted-engine脚本会显示已输入的信息,并提示您确认这些信息。Please confirm installation settings (Yes, No)[Yes]: Yes
ovirt-engine 和高可用性服务,并把主机和共享存储域连接到 Manager 虚拟机。
hosted-engine 部署脚本成功完成后,Red Hat Virtualization Manager 就已经被配置完成,并在您的主机上运行。Manager 已经配置好了数据中心、集群、主机、Manager 虚拟机,以及 Manager 虚拟机专用的共享存储域。
重要
ovirt-engine-extension-aaa-ldap-setup 设置脚本在您的环境中添加目录服务器。如需了解更多相关信息,请参阅管理指南中的 Configuring an External LDAP Provider。
--generate-answer=<file> 参数指定应答文件,它会被默认存为 /etc/ovirt-hosted-engine/answers.conf。
注意
sshd 服务正在运行。编辑 /etc/ssh/sshd_config,把以下两个选项设置为 yes:
PasswordAuthenticationPermitRootLogin
sshd 服务来使所做的修改生效。
2.3. 管理 Manager 虚拟机
hosted-engine 工具程序可以帮助进行对 Manager 虚拟机的管理。它可以在环境中的任何自承载引擎主机上运行。运行 hosted-engine --help 将显示所有可用的选项,hosted-engine --command --help 会显示相关命令的帮助信息。
第 3 章 对自承载引擎进行故障排除
3.1. 对 Manager 虚拟机进行故障排除
过程 3.1. 对 Manager 虚拟机进行故障排除
- 运行
hosted-engine --vm-status检查 Manager 虚拟机的状态。注意
对 Manager 虚拟机所做的修改大约需要经过 20 秒后才会反映在状态命令的输出中。如果 Manager 虚拟机已启动并在运行,您将可以看到以下输出:--== Host 1 status ==-- Status up-to-date : True Hostname : hypervisor.example.com Host ID : 1 Engine status : {"health": "good", "vm": "up", "detail": "up"} Score : 3400 stopped : False Local maintenance : False crc32 : 99e57eba Host timestamp : 248542 - 如果 是“bad”或 是“down”,启用全局维护模式使主机不再被 HA 服务管理。
- 在管理门户中,在引擎虚拟机上点鼠标右键,选启动全局 HA 维护。
- 您也可以通过命令行设置维护模式:
# hosted-engine --set-maintenance --mode=global
- 如果 Manager 虚拟机已关闭,启动 Manager 虚拟机。如果虚拟机已启动,跳过这一步。
# hosted-engine ---vm-start
- 设置控制台密码:
# hosted-engine --add-console-password
- 连接到控制台。在提示时输入前一步中设置的密码。如需了解更多与控制台选项相关的信息,请参阅 https://access.redhat.com/solutions/2221461。
# hosted-engine --console
- 找出 Manager 虚拟机关闭或处于一个“不健康状态”的原因。检查
/var/log/messages和/var/log/ovirt-engine/engine.log。在解决了相关问题后,重新启动 Manager 虚拟机。 - 以 root 用户身份登录到 Manager 虚拟机,检查
ovirt-engine已被启动并在运行:# service ovirt-engine status
- 在确认 Manager 虚拟机已启动并运行后,关闭控制台会话,禁用维护模式并重新启用 HA 服务:
# hosted-engine --set-maintenance --mode=none
额外的故障排除命令:
重要
hosted-engine --reinitialize-lockspace:当 sanlock 的锁定空间出现问题时可以使用这个命令。在使用这个命令重新初始化 sanlock 锁定空间前,请确认已启用了全局维护模式, Manager 虚拟机已被停止。hosted-engine --clean-metadata:从全局状态数据库中删除主机代理的元数据。这将会使其它所有主机都忘掉这个主机。请确认目标主机已被关闭,全局维护模式已启用。hosted-engine --check-liveliness:这个命令用来检查 ovirt-engine 服务的活性(liveliness)页。您也可以通过使用一个网络浏览器连接到https://engine-fqdn/ovirt-engine/services/health/进行检查。hosted-engine --connect-storage:这个命令会指示 VDSM 准备主机和 Manager 虚拟机所需的所有存储连接。这通常在自承载引擎部署过程中在后端运行。如果需要运行这个命令来对存储进行故障排除,请确定已启用了全局维护模式。
3.2. 清理一个失败的自承载引擎部署
Failed to connect to broker, the number of errors has exceeded the limit.
第 4 章 迁移到一个基于 RHEL 的自承载环境
4.1. 迁移到自承载环境
hosted-engine 脚本来简化迁移的过程。这个脚本会要求用户输入一系列信息,并根据提供的信息对环境进行配置。在以下过程中,标准 Red Hat Virtualization 环境中的 Manager 被称为 BareMetal-Manager。
engine-setup。在迁移过程中,用户需要手工运行 engine-setup,这样才可以提前在新的 Manager 虚拟机上恢复 BareMetal-Manager 备份文件。
- 运行
hosted-engine脚本来配置主机作为自承载引擎的主机,并创建一个新的 Red Hat Virtualization 虚拟机。 - 使用
engine-backup工具程序备份引擎数据库和配置文件,把备份数据复制到新的 Manager 虚拟机上,并使用带有--mode=restore选项的engine-backup命令恢复备份。运行engine-setup对 Manager 虚拟机进行配置。 - 使用
hosted-engine脚本进行设置。
先决条件
- 准备一个安装了 ovirt-hosted-engine-setup 软件包的新主机。请参阅 第 2.1 节 “在 Red Hat Enterprise Linux 主机上部署自承载引擎” 以获得相关的详细信息。主机需要是当前 Red Hat Virtualization 环境支持的版本。
注意
如果选择使用一个已存在的主机,把它设置为维护模式,并把它移出当前的环境。请参阅 管理指南中的 Removing a Host 以获得更详细的信息。 - 通过安装 rhevm-appliance 软件包可以获得 RHV-M Virtual Appliance。RHV-M Virtual Appliance 总是基于最新支持的 Manager 版本。请确认您当前环境中的 Manager 版本被更新到最新支持的 Y-stream 版本,因为 Manager 的版本需要相同才可以进行迁移。
- 如果使用 RHV-M Virtual Appliance 安装 Manager,需要保证一个目录有最少 60 GB 空间。
hosted-engine脚本会首先检查/var/tmp是否有足够的空间来展开 appliance 文件。如果空间不够,则需要指定一个不同的目录。 - 新的 Manager 的完全限定域名需要和原始 BareMetal-Manager 的完全限定域名相同。DNS 中需要有它的正向和反向查询记录。
- 需要有访问和修改 BareMetal-Manager 的权限。
过程 4.1. 迁移到自承载环境
开始自承载引擎部署
运行hosted-engine脚本。使用 CTRL+D 可以随时中断部署。我们推荐在运行脚本时使用screen程序,这样可以避免因为网络中断或其它原因造成脚本运行被中断。screen 软件包包括在标准的 Red Hat Enterprise Linux 软件仓库中。# yum install screen
# screen
# hosted-engine --deploy
注意
当网络中断或超时时,可以运行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]:
- 对于 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 地址指定它的完整地址,以及共享存储域的路径名。
重要
当前只支持 replica 3 Gluster 存储。请确认已进行了以下配置:- 在所有 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]:
配置网络
这个脚本会检测可以被用来对环境进行管理的网卡(NIC),然后会检查防火墙的配置,并根据控制台(SPICE 或 VNC)访问 HostedEngine-VM 的需要来修改防火墙的配置。另外,提供一个可以被 ping 到的网络 IP 地址,ovirt-ha-agent会使用它来决定 HostedEngine-VM 是否在正常运行。Please indicate a nic to set rhvm 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]:
配置虚拟机
这个脚本会创建一个被配置为 Red Hat Virtualization Manager 的虚拟机(称为 HostedEngine-VM)。选择 作为引导设备类型,脚本会自动检测可用的 RHV-M Appliance。选择一个 appliance。Please specify the device to boot the VM from (choose disk for the oVirt engine appliance) (cdrom, disk, pxe) [disk]: Please specify the console type you would like to use to connect to the VM (vnc, spice) [vnc]: vnc [ 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)如果使用 cloud-init 对 Manager 虚拟机进行初始设置,则选Yes。选择 来使用 cloud-init 进行配置,如设置 root 密码、配置网络、配置主机名。或选择 来使用一个已存在的 cloud-init 脚本来处理相关的 cloud-init 功能。为 Manager 虚拟机设置 FQDN。这需要和 BareMetal-Manager 的 FQDN 相同。注意
如需了解更多与 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
对于以下问题,回答No,这样才可以在运行engine-setup前在 HostedEngine-VM 上恢复 BareMetal-Manager 备份文件。Automatically execute engine-setup on the engine appliance on first boot (Yes, No)[Yes]? No
配置 Manager 的域名、root 密码、网络、硬件和控制台访问详情。Enter root password that will be used for the engine appliance (leave it empty to skip): p@ssw0rd Confirm appliance root password: p@ssw0rd 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]: 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配置自承载引擎
指定在 Red Hat Virtualization 环境中标识 Host-HE1 的名称,以及访问管理门户所使用的admin@internal用户的密码。最后,提供 SMTP 的名称和 TCP 端口号、发送事件通知的电子邮件地址、以及需要接收事件通知的用户的电子邮件地址列表(以逗号分隔)。Enter engine admin password: p@ssw0rd Confirm engine admin password: p@ssw0rd Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]: 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]:配置预览
在实际进行配置前,hosted-engine脚本会显示已输入的信息,并提示您确认这些信息。Bridge interface : eth1 Engine FQDN : manager.example.com Bridge name : ovirtmgmt Host address : host.example.com 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 : 50 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]:
配置 HostedEngine-VM
这个脚本会创建虚拟机 HostedEngine-VM,并提供和它进行连接的信息。您需要在 HostedEngine-VM 上恢复备份文件后,手工运行engine-setup,这样才能继续在 Host-HE1 上执行hosted-engine脚本。[ INFO ] Stage: Transaction setup ... [ INFO ] Creating VM You can now connect to the VM with the following command: /bin/remote-viewer vnc://localhost:5900 Use temporary password "3463VnKn" 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/8f74b589-8c6f-4a32-9adf-6e615b69de07.sock,user=ovirt-vmconsole STDIO,raw,echo=0,escape=1 Please ensure that your Guest OS is properly configured to support serial console according to your distro documentation. Follow http://www.ovirt.org/Serial_Console_Setup#I_need_to_access_the_console_the_old_way for more info. 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. The VM has been rebooted. To continue please install oVirt-Engine in the VM (Follow http://www.ovirt.org/Quick_Start_Guide for more info). Make a selection from the options below: (1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is up (2) Abort setup (3) Power off and restart the VM (4) Destroy VM and abort setup (1, 2, 3, 4)[1]:运行以下命令使用 VNC 协议连接到虚拟机。使用自承载引擎主机的 FQDN 或 IP 地址替换其中的 FQDN。# /bin/remote-viewer vnc://FQDN:5900
在 HostedEngine-VM 上启用 SSH
默认情况下,SSH 密码验证不会在 RHV-M Virtual Appliance 中启动,您可以通过 VNC 连接到 HostedEngine-VM 并启用 SSH 密码验证功能,这样,就可以通过 SSH 访问虚拟机来恢复 BareMetal-Manager 备份文件并配置新的 Manager。确认sshd服务已在运行。编辑/etc/ssh/sshd_config,把以下两个选项设置为yes:[...] PermitRootLogin yes [...] PasswordAuthentication yes
重启sshd服务来使所做的修改生效。# service sshd restart
禁用 BareMetal-Manager
连接到 BareMetal-Manager(Red Hat Virtualization 环境中的 Manager),停止引擎并禁止它在系统引导时运行。# service ovirt-engine stop # chkconfig ovirt-engine off
注意
推荐停止运行 BareMetal-Manager,这可以确保在系统备份被创建后,不会再对虚拟环境进行改变。另外,它还可以防止 BareMetal-Manager 和 HostedEngine-VM 同时管理存在的资源。更新 DNS
更新您的 DNS,从而使 Red Hat Virtualization 环境的 FQDN 可以正确地解析 HostedEngine-VM 的 IP 地址,以及在 Host-HE1 上配置hosted-engine部署脚本所提供的 FQDN。在这里,FQDN 被设置为 manager.example.com,因为所提供引擎的 FQDN 和新设置引擎的 FQDN 必须相同。为 BareMetal-Manager 创建一个备份
连接到 BareMetal-Manager,运行engine-backup命令。使用--mode=backup、--file=FILE和--log=LogFILE参数来分别指定备份的模式、备份文件的名称以及日志文件的名称。# engine-backup --mode=backup --file=FILE --log=LogFILE
把备份文件复制到 HostedEngine-VM
登录到 BareMetal-Manager,把备份文件复制到 HostedEngine-VM 上。在以下的例子中,manager.example.com 是 HostedEngine-VM 的 FQDN,/backup/ 是备份文件要被复制到的目录或路径。如果这些目录和路径还没有存在,您需要登录到 HostedEngine-VM 上后创建它们。# scp -p FILE LogFILE manager.example.com:/backup/
在 HostedEngine-VM 上恢复备份文件
使用engine-backup工具程序恢复一个完整的备份。如果在执行engine-setup的过程中手工配置了 BareMetal-Manager 数据库,则需要根据 第 6.2.3 节 “手工恢复自承载引擎 Manager” 中的内容手工恢复备份的环境。- 如果只恢复 Manager,运行以下命令:
# engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --restore-permissions
- 如果恢复 Manager 和 Data Warehouse,运行以下命令:
# engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --provision-dwh-db --restore-permissions
如果运行成功,以下输出会被显示:You should now run engine-setup. Done.
配置 HostedEngine-VM
配置恢复的 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 ==-- --== PKI CONFIGURATION ==-- --== APACHE CONFIGURATION ==-- --== SYSTEM CONFIGURATION ==-- --== END OF CONFIGURATION ==-- [ INFO ] Stage: Setup validation [ INFO ] Cleaning stale zombie tasks --== CONFIGURATION PREVIEW ==-- Default SAN wipe after delete : False Firewall manager : iptables Update Firewall : True Host FQDN : manager.example.com Engine database secured connection : False Engine database host : X.X.X.X Engine database user name : engine Engine database name : engine Engine database port : 5432 Engine database host name validation : False Engine installation : True PKI organization : example.com NFS mount point : /var/lib/exports/iso Configure VMConsole Proxy : True Engine Host FQDN : manager.example.com Configure WebSocket Proxy : True Please confirm installation settings (OK, Cancel) [OK]:把主机和 Manager 进行同步
返回到 Host-HE1,选择选项 1 来继续hosted-engine脚本:(1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is up
这个脚本会显示内部 CA 的内容,并提示您选择 Host-HE1 要加入的集群。[ INFO ] Engine replied: DB Up!Welcome to Health Status! [ INFO ] Acquiring internal CA cert from the engine [ INFO ] The following CA certificate is going to be used, please immediately interrupt if not correct: [ INFO ] Issuer: C=US, O=example.com, CN=manager.example.com.23240, Subject: C=US, O=example.com, CN=manager.example.com.23240, Fingerprint (SHA-1): XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [ INFO ] Connecting to the Engine Enter the name of the cluster to which you want to add the host (DB1, DB2, Default) [Default]: [ INFO ] Waiting for the host to become operational in the engine. This may take several minutes... [ INFO ] The VDSM Host is now operational [ INFO ] Saving hosted-engine configuration on the shared storage domain Please shutdown the VM allowing the system to launch it as a monitored service. The system will wait until the VM is down.关闭 HostedEngine-VM
关闭 HostedEngine-VM。# shutdown -h now
设置确认
返回到 Host-HE1,确认它检测到 HostedEngine-VM 已经被关闭。[ INFO ] Enabling and starting HA services [ INFO ] Stage: Clean up [ INFO ] Generating answer file '/var/lib/ovirt-hosted-engine-setup/answers/answers-20160509162843.conf' [ INFO ] Generating answer file '/etc/ovirt-hosted-engine/answers.conf' [ INFO ] Stage: Pre-termination [ INFO ] Stage: Termination [ INFO ] Hosted Engine successfully set up
第 5 章 维护和升级资源
5.1. 维护自承载引擎
global- 机器中的所有高可用代理都不会监测引擎虚拟机的状态。当要进行的设置或升级操作需要停止引擎时,您需要设置 global 维护模式。例如,升级 Red Hat Virtualization。local- 发出命令的主机上的高可用性代理不会监测引擎虚拟机的状态。当主机处于local维护模式时,它不会被用来运行虚拟机;如果把正在运行引擎虚拟机的主机设为这个模式,引擎会被迁移到另外一个主机上。当应用系统改变或更新主机时,我们推荐您把主机设为 local 维护模式。none- 禁用维护模式,确保高可用性代理可以正常工作。
过程 5.1. 维护一个基于 RHEL 的自承载引擎(local 维护模式)
- 把一个自承载引擎主机设置为本地维护模式:
- 在管理门户中,把主机设置为维护模式,主机会自动进入本地维护模式。
- 您也可以通过命令行设置维护模式:
# hosted-engine --set-maintenance --mode=local
- 在进行完维护任务后,禁用维护模式:
# hosted-engine --set-maintenance --mode=none
过程 5.2. 维护一个基于 RHEL 的自承载引擎(global 维护模式)
- 把一个自承载引擎主机设置为全局维护模式:
- 在管理门户中,在引擎虚拟机上点鼠标右键,选启动全局 HA 维护。
- 您也可以通过命令行设置维护模式:
# hosted-engine --set-maintenance --mode=global
- 在进行完维护任务后,禁用维护模式:
# hosted-engine --set-maintenance --mode=none
5.2. 从自承载引擎环境中删除一个主机
过程 5.3. 从自承载引擎环境中删除一个主机
- 在管理门户中,点主机标签页。选择主机并点维护把这个主机设置为本地维护模式。这会停止
ovirt-ha-agent服务和ovirt-ha-broker服务。 - 登录到主机,禁用 HA 服务,并使这个服务不会在系统重启时被启动:
# systemctl disable ovirt-ha-agent # systemctl disable ovirt-ha-broker
- 删除自承载引擎配置文件:
# rm /etc/ovirt-hosted-engine/hosted-engine.conf
- 在管理门户中,选择相同的主机,点删除打开删除主机确认窗口。点。
5.3. 升级基于 RHEL 的自承载引擎环境
重要
注意
- 把管理 Manager 虚拟机的高可用性代理设置为全局维护(global maintenance )模式。
- 启用所需的软件仓库并更新 Manager 软件包。
- 运行升级工具程序来升级 Manager。
- 更新主机。
- 在更新完 Manager 虚拟机以及集群中的所有主机后,把集群兼容版本改为 4.0。
重要
过程 5.4. 升级自承载引擎
- 在所有自承载引擎主机上禁用高可用性代理。在集群中的主机上运行以下命令:
# hosted-engine --set-maintenance --mode=global
注意
运行hosted-engine --vm-status命令来确认环境处于维护模式。 - 在当前被设置为 SPM 的、包括 Manager 虚拟机的主机上启用所需的软件仓库。
# subscription-manager repos --enable=rhel-7-server-rhv-4-mgmt-agent-rpms
- 在 Manager 虚拟机上启用所需的软件仓库。
# subscription-manager repos --enable=rhel-7-server-rhv-4.0-rpms
- 把除 Manager 虚拟机以外的所有虚拟机迁移到其它主机上。
- 在主机上更新 Manager 虚拟机软件包。
# yum update ovirt-hosted-engine-setup rhevm-appliance
- 运行升级脚本来升级 Manager 虚拟机。如果还没有安装 screen 软件包,则安装这个软件包(它包括在标准的 Red Hat Enterprise Linux 软件仓库中)。
# yum install screen
# screen
# hosted-engine --upgrade-appliance
注意
如果检测到多个 applicance,您会被提示选择要使用的 applicance。它还会要求您创建 Manager 数据库的备份,并提供它的位置信息。 - 在升级完成后,禁用全局维护模式:
# hosted-engine --set-maintenance --mode=none
hosted-engine --vm-poweroff 命令关闭 Manager,然后通过运行 hosted-engine --rollback-upgrade 回滚升级操作。
# subscription-manager repos --disable=*
# subscription-manager repos --enable=rhel-7-server-rhv-4-mgmt-agent-rpms
5.4. 升级基于 RHEV-H 的自承载引擎环境
重要
- 把管理 Manager 虚拟机的高可用性代理设置为全局维护(global maintenance )模式。
- 在环境中添加一个新的 RHVH 4.0 主机。
- 把 Manager 虚拟机迁移到新的主机上,并把它设置为 SPM。
- 运行升级工具程序来升级 Manager。
- 更新主机。
- 在更新完 Manager 虚拟机以及集群中的所有主机后,把集群兼容版本改为 4.0。
过程 5.5. 升级自承载引擎
- 安装新的 RHVH 4.0 主机。详情请参阅安装指南。
- 把新主机添加到环境中。
注意
新主机需要以一个额外的自承载引擎主机的形式加入才可以运行 Manager 虚拟机。相关信息,请参阅 第 7 章 在自承载环境中安装额外的主机。 - 在所有自承载引擎主机上禁用高可用性代理。在集群中的主机上运行以下命令:
# hosted-engine --set-maintenance --mode=global
注意
运行hosted-engine --vm-status命令来确认环境处于维护模式。 - 从客户门户网站下载 RHV-M Virtual Appliance,并把它复制到新主机上:
- 登录到客户门户网站 https://access.redhat.com。
- 点菜单条中的下载。
- 点 Red Hat Enterprise Virtualization > 来访问产品的下载页。
- 选择 Red Hat Virtualization 4.0 的 applicance,点 。
把 OVA 文件复制到 Red Hat Virtualization Host:scp rhvm-appliance.ova root@host.example.com:/usr/share
- 把 Manager 虚拟机迁移到 RHVH 4.0 主机,把主机设置为 SPM。
- 在 Manager 虚拟机上启用所需的软件仓库。
# subscription-manager repos --enable=rhel-7-server-rhv-4.0-rpms
- 运行升级脚本来升级 Manager 虚拟机。如果还没有安装 screen 软件包,则安装这个软件包。
# yum install screen
# screen
# hosted-engine --upgrade-appliance
注意
脚本会要求提供复制到主机上的 RHV-M Virtual Appliance 的位置信息。它还会要求您创建 Manager 数据库的备份,并提供它的位置信息。 - 在升级完成后,禁用全局维护模式:
# hosted-engine --set-maintenance --mode=none
hosted-engine --vm-poweroff 命令关闭 Manager,然后通过运行 hosted-engine --rollback-upgrade 回滚升级操作。
# subscription-manager repos --disable=*
# subscription-manager repos --enable=rhel-7-server-rhv-4-mgmt-agent-rpms
第 6 章 备份和恢复基于 RHEL 的自承载引擎环境
注意
过程 6.1. 备份自承载引擎环境的流程
- 引擎虚拟机运行在
Host 2上,其它 6 个普通的虚拟机被平均分配在 3 个主机上运行。
把Host 1设置为维护模式。这会把在Host 1上运行的虚拟机迁移到其它主机上,使它不再运行虚拟机负载,并在备份时作为故障转移主机。 Host 1现在是维护模式。以前在它上面运行的虚拟机被迁移到 Host 3。
使用engine-backup命令对环境进行备份。在备份完成后,Host 1可以被重新激活来运行包括引擎虚拟机在内的虚拟机。
过程 6.2. 恢复自承载引擎环境的流程
Host 1被用来部署一个新的自承载引擎,并恢复了在前面的示例中进行的备份。部署恢复的环境包括一些额外的步骤:- 当 Red Hat Virtualization Manager 在引擎虚拟机上安装后,但还没有运行
engine-setup前,使用engine-backup工具程序恢复备份。 - 在
engine-setup配置并恢复了 Manager 后,登录到管理门户并删除Host 1(它存在于备份中)。当在部署新的Host 1时,如果旧的Host 1没有被删除并存在于 Manager 中,引擎虚拟机将无法和新的Host 1进行同步,从而导致部署失败。
当Host 1和引擎虚拟机进行同步后,部署过程就已完成,现在的环境可以被看作为一个可以进行基本操作的环境。因为只有一个承载引擎的主机,引擎主机无法实现高可用性功能。但是,如果需要,具有高优先级的虚拟机可以在Host 1上运行。所有标准的 RHEL 主机(存在于环境中,但不是自承载引擎主机)将会成为活跃的主机,那些在备份时活跃的虚拟机现在可以在这些主机上运行,并在 Manager 中有效。- 在它们当前的状态下,
Host 2和Host 3无法被恢复。这些主机需要从环境中删除并使用 hosted-engine 部署脚本重新把它们添加进环境。如需了解更详细的相关信息,请参阅 第 6.2.4 节 “从恢复的自承载引擎环境中删除状态为 Non-Operational 的主机” 和 第 7 章 在自承载环境中安装额外的主机。
Host 2和Host 3被重新部署到恢复的环境中。除了引擎虚拟机在Host 1上运行外,现在的环境与在进行备份前的状态完全相同。
6.1. 备份自承载引擎 Manager 虚拟机
engine-backup,它可以在不影响 ovirt-engine 服务的情况下进行。engine-backup 只备份 Red Hat Virtualization Manager 虚拟机,而不备份 Manager 虚拟机所在的主机,或环境中的其它虚拟机。
过程 6.3. 备份原始的 Red Hat Virtualization Manager
准备故障转移主机(failover host)
故障转移主机(一个可以运行引擎的主机)需要被设置为维护模式,从而保证在备份时它没有运行虚拟机。这个主机在以后可以被用来部署恢复的自承载引擎环境。任何一个可以运行引擎的主机都可以作为一个故障转移主机,但是使用Host 1会使恢复的过程更加直接。Host 1主机的默认名是hosted_engine_1,它在 hosted-engine 部署脚本初始运行时被设置。- 登录到可以运行引擎的一个主机上。
- 确认
hosted_engine_1主机是Host 1;# hosted-engine --vm-status
- 登录到管理门户。
- 点主机标签页。
- 在结果列表中选
hosted_engine_1主机,点。 - 点。
取决于主机上的虚拟负载,迁移主机上的所有虚拟机会需要一些时间完成。当主机状态变为Maintenance时,进行下一步操作。创建一个 Manager 的备份
在 Manager 虚拟机上,备份配置设置和数据库的内容。把 [EngineBackupFile] 替换为备份文件的文件名;把 [LogFILE] 替换为备份日志文件的文件名。# engine-backup --mode=backup --file=[EngineBackupFile] --log=[LogFILE]
把文件备份到一个外部服务器上
把文件备份到一个外部服务器上。在以下的例子中,[Storage.example.com] 是保存备份文件的一个网络存储服务器的完全限定域名;/backup/ 是保存备份文件的目录或路径。备份的文件需要可以被访问来恢复环境设置以及数据库中的数据。# scp -p [EngineBackupFiles] [Storage.example.com:/backup/EngineBackupFiles]
激活故障转移主机
取消hosted_engine_1主机的维护模式。- 登录到管理门户。
- 点主机标签页。
- 在结果列表中选
hosted_engine_1。 - 点。
6.2. 恢复自承载引擎环境
engine-backup 工具程序。
- 创建一个全新安装的 Red Hat Enterprise Linux 主机并运行 hosted-engine 部署脚本。
- 在新的 Manager 虚拟机上恢复 Red Hat Enterprise Manager 的配置设置,以及数据库的内容。
- 删除处于 Non Operational 状态的主机,并在恢复的自承载环境中重新安装它们。
前提条件
- 一个安装了全新 Red Hat Enterprise Linux 系统的物理主机来恢复自承载引擎环境。
- 新的主机和 Manager 的操作系统版本必须和原来的版本相同。
- 新环境需要具有 Red Hat Subscription Manager 权利。如需获得所需权利的完整列表,请参阅安装指南中的 Subscribing to the Required Entitlements。
- 新的 Manager 的完全限定域名需要和原始 Manager 的完全限定域名相同。DNS 中需要有它的正向和反向查询记录。
6.2.1. 创建一个新的自承载引擎环境作为恢复的环境
Host 1)使用默认的值作为主机名 - hosted_engine_1,这个主机名也在这里使用。因为自承载引擎恢复的特性,在对所恢复的引擎进行最后的同步前,使用的故障转移主机需要被删除(这要求在进行备份时,主机上没有运行任何虚拟机)。另外,您也可以在备份环境外的硬件上进行恢复。
重要
过程 6.4. 创建一个新的自承载环境作为恢复的环境
更新 DNS
更新 DNS,使 Red Hat Virtualization 环境的完全限定域名与新 Manager 的 IP 地址相对应。在以下过程中,完全限定域名被设置为 Manager.example.com。引擎的完全限定域名需要和备份中的原始引擎使用的值相同。初始化引擎
在新安装的 Red Hat Enterprise Linux 主机上运行hosted-engine脚本开始部署的过程。您可以在任何时候使用 CTRL+D 键终止部署的过程。如果通过网络运行hosted-engine部署脚本,则推荐使用screen窗口管理程序以避免在出现网络问题或其它问题时丢失部署进程。如果还没有安装,请安装 screen。# screen
# hosted-engine --deploy
准备初始化
脚本开始会要求您确认在自承载引擎环境中作为虚拟机管理程序(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]:
配置存储
选择使用的存储类型。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 地址指定它的完整地址,以及共享存储域的路径名。
重要
当前只支持 replica 3 Gluster 存储。请确认已进行了以下配置:- 在所有 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]:
配置网络
这个脚本会检索可以作为环境的管理网桥的网卡(NIC),然后检查防火墙的配置,并根据控制台(SPICE 或 VNC)访问 Manager 虚拟机的需要来修改防火墙的配置。另外,它还需要一个可以被 ping 到的网关 IP 地址,ovirt-ha-agent会使用它来决定主机是否适合运行 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]:
配置新的 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]:指定主机的名称
指定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]:
配置引擎
提供新的 Manager 虚拟机的完全限定域名。在这里使用 Manager.example.com 作为完全限定域名。指定 SMTP 服务器的名称、TCP 端口号、发送通知电子邮件的电邮地址、接收通知的一组电邮地址(以逗号分隔)。重要
为引擎提供的完全限定域名(Manager.example.com)必须和初始设置原始 Manager 时提供的完全限定域名相同。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]:
配置预览
在实际进行配置前,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]:
创建新的 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
安装虚拟机操作系统
连接到 Manager 虚拟机,安装 Red Hat Enterprise Linux 7 作为操作系统。把主机和 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]:安装 Manager
连接到新的 Manager 虚拟机,确认所有安装的软件包都是最新版本,安装 rhevm 软件包。# yum update
# yum install rhevm
6.2.2. 恢复自承载引擎 Manager
engine-backup 工具程序来自动为备份的自承载引擎 Manager 虚拟机和 Data Warehouse 恢复设置以及数据库的内容。这些内容只适用于初始运行 engine-setup 时自动配置的组件。如果在运行 engine-setup 时手工配置了数据库,请参照 第 6.2.3 节 “手工恢复自承载引擎 Manager” 中的内容手工恢复备份的环境。
过程 6.5. 恢复自承载引擎 Manager
- 把备份文件安全地复制到新的 Manager 虚拟机上。以下示例把文件从一个网络存储服务器复制到 第 6.1 节 “备份自承载引擎 Manager 虚拟机” 所复制的文件中。Storage.example.com 是存储服务器的完全限定域名;/backup/EngineBackupFiles 是备份文件在存储服务器上的文件路径;/backup/ 是文件要被复制到的、在新 Manager 机器上的文件路径。
# scp -p Storage.example.com:/backup/EngineBackupFiles /backup/
- 使用
engine-backup工具程序恢复一个完整的备份。- 如果只恢复 Manager,运行以下命令:
# engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --restore-permissions
- 如果恢复 Manager 和 Data Warehouse,运行以下命令:
# engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --provision-dwh-db --restore-permissions
如果运行成功,以下输出会被显示:You should now run engine-setup. Done.
- 配置恢复的 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]: 从恢复的环境中删除主机
如果被恢复的自承载引擎部署在一个新硬件中,而这个硬件系统的名称没有出现在备份的引擎中,则跳过这一步。这一步只适用于在一个故障转移主机上(hosted_engine_1)进行部署的情况。因为这个主机在备份时已存在,它仍然还会存在于恢复的引擎中。因此,在进行最后的同步前,需要把它先从环境中删除。- 登录到管理门户
- 点主机标签页。故障转移主机(
hosted_engine_1)会处于维护模式,而且没有运行任何虚拟机。 - 点。
- 点。
注意
如果需要删除的主机的状态为 non-operational,请参照 第 6.2.4 节 “从恢复的自承载引擎环境中删除状态为 Non-Operational 的主机” 中的介绍来强制删除这个主机。把主机和 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.- 关闭新的 Manager 虚拟机。
# shutdown -h now
- 返回到主机,确认它检测到 Manager 虚拟机已被关闭。
[ INFO ] Enabling and starting HA services Hosted Engine successfully set up [ INFO ] Stage: Clean up [ INFO ] Stage: Pre-termination [ INFO ] Stage: Termination - 激活主机。
- 登录到管理门户
- 点主机标签页。
- 选
hosted_engine_1并点维护按钮。主机可能会需要几分钟时间进入维护模式。 - 点按钮。
一旦激活后,hosted_engine_1就可以竞争成为 SPM,存储域和数据中心都变为活跃状态。 - 对状态为 Non Responsive 的主机进行手工隔离(fencing),这会使它上面的虚拟机迁移到其它活跃的主机上。在管理门户中,点主机右键,选确认“主机已被重启”。当进行备份时在那个主机上运行的所有虚拟机都会被从那个主机上删除,并从 Unknown 状态变为 Down 状态。这些虚拟机现在可以在
hosted_engine_1上运行。使用 REST API 把被隔离的主机强制删除。
hosted_engine_1 活跃时的状态,并可以在恢复的环境中运行虚拟机。那些处于 Non Operational 状态的、可以运行引擎的主机现在就可以按照 第 6.2.4 节 “从恢复的自承载引擎环境中删除状态为 Non-Operational 的主机” 中的步骤被删除,并根据 第 7 章 在自承载环境中安装额外的主机 中介绍的步骤在新环境中重新安装。
注意
6.2.3. 手工恢复自承载引擎 Manager
过程 6.6. 恢复自承载引擎 Manager
- 手工创建一个空的数据库来保存从备份中恢复的数据库内容。以下操作需要在数据库所在的机器上执行。
- 如果数据库不在 Manager 虚拟机上,则需要安装 postgresql-server 软件包。如果虚拟机位于 Manager 所在的虚拟机上,则不需要进行这一步,因为这个软件包已包括在 rhevm 软件包中。
# yum install postgresql-server
- 初始化
postgresql数据库,启动postgresql服务,把它设置为在系统引导时被自动启动:# service postgresql initdb # service postgresql start # chkconfig postgresql on
- 进入 postgresql 命令行:
# su postgres $ psql
- 创建
engine用户:postgres=# create role engine with login encrypted password 'password';
如果还需要恢复 Data Warehouse,在相关的主机上创建ovirt_engine_history用户:postgres=# create role ovirt_engine_history with login encrypted password 'password';
- 创建新数据库:
postgres=# create database database_name owner engine template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
如果还需要恢复 Data Warehouse,在相关的主机上创建数据库: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';
- 退出 postgresql 命令行并登出 postgres 用户:
postgres=# \q $ exit
- 编辑
/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
- 重启
postgresql服务:# service postgresql restart
- 把备份文件安全地复制到新的 Manager 虚拟机上。以下示例把文件从一个网络存储服务器复制到 第 6.1 节 “备份自承载引擎 Manager 虚拟机” 所复制的文件中。Storage.example.com 是存储服务器的完全限定域名;/backup/EngineBackupFiles 是备份文件在存储服务器上的文件路径;/backup/ 是文件要被复制到的、在新 Manager 机器上的文件路径。
# scp -p Storage.example.com:/backup/EngineBackupFiles /backup/
- 恢复一个完整备份或数据库备份(通过
--change-db-credentials参数指定新数据库的凭证信息)。Manager 本地数据库的 database_location 是localhost:注意
在以下的例子中,对于每个数据库都使用了没有指定密码的--*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
如果需要恢复作为完全备份一部分的 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-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 --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=files --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.
- 配置恢复的 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]: 从恢复的环境中删除主机
如果被恢复的自承载引擎部署在一个新硬件中,而这个硬件系统的名称没有出现在备份的引擎中,则跳过这一步。这一步只适用于在一个故障转移主机上(hosted_engine_1)进行部署的情况。因为这个主机在备份时已存在,它仍然还会存在于恢复的引擎中。因此,在进行最后的同步前,需要把它先从环境中删除。- 登录到管理门户。
- 点主机标签页。故障转移主机(
hosted_engine_1)会处于维护模式,而且没有运行任何虚拟机。 - 点。
- 点。
把主机和 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.- 关闭新的 Manager 虚拟机。
# shutdown -h now
- 返回到主机,确认它检测到 Manager 虚拟机已被关闭。
[ INFO ] Enabling and starting HA services Hosted Engine successfully set up [ INFO ] Stage: Clean up [ INFO ] Stage: Pre-termination [ INFO ] Stage: Termination - 激活主机。
- 登录到管理门户。
- 点主机标签页。
- 选
hosted_engine_1并点维护按钮。主机可能会需要几分钟时间进入维护模式。 - 点按钮。
一旦激活后,hosted_engine_1就可以竞争成为 SPM,存储域和数据中心都变为活跃状态。 - 对状态为 Non Responsive 的主机进行手工隔离(fencing),这会使它上面的虚拟机迁移到其它活跃的主机上。在管理门户中,点主机右键,选确认“主机已被重启”。当进行备份时在那个主机上运行的所有虚拟机都会被从那个主机上删除,并从 Unknown 状态变为 Down 状态。这些虚拟机现在可以在
hosted_engine_1上运行。使用 REST API 把被隔离的主机强制删除。
hosted_engine_1 活跃时的状态,并可以在恢复的环境中运行虚拟机。那些处于 Non Operational 状态的、可以运行引擎的主机现在就可以按照 第 6.2.4 节 “从恢复的自承载引擎环境中删除状态为 Non-Operational 的主机” 中的步骤被删除,并根据 第 7 章 在自承载环境中安装额外的主机 中介绍的步骤在新环境中重新安装。
注意
6.2.4. 从恢复的自承载引擎环境中删除状态为 Non-Operational 的主机
隔离无法正常工作的主机
在管理门户中,在主机上点鼠标右键,选确认“主机已被重启”。当进行备份时在那个主机上运行的所有虚拟机都会被从那个主机上删除,并从 Unknown 状态变为 Down 状态。使用 REST API 把被隔离的主机强制删除。获得 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
获得要被删除的主机的 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 Virtualization REST API 相关的信息,请参阅 Red Hat Virtualization REST API Guide。删除隔离的主机
使用带有被隔离主机的 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请求可以被用来删除自承载引擎环境中的每一个被隔离的主机。从主机上删除自承载引擎配置
删除存在的主机自承载引擎配置,从而可以在主机被重新安装到一个自承载引擎环境中时对它进行配置。登录到主机,删除配置文件:# rm /etc/ovirt-hosted-engine/hosted-engine.conf
第 7 章 在自承载环境中安装额外的主机
预备条件
- 对于一个基于 RHEL 的自承载引擎环境,您需要已在一台物理主机上全新安装了 Red Hat Enterprise Linux 系统,并为主机订阅了所需的权利。如需了解更多与订阅相关的信息,请参阅安装指南中的 Subscribing to the Required Entitlements。
- 对于一个基于 RHVH 的自承载引擎环境,需要在一个物理主机上准备一个全新安装的 Red Hat Virtualization Host 系统。相关信息,请参阅安装指南中的 Red Hat Virtualization Hosts。
- 如果重新使用一个自承载引擎主机,则需要删除它的已存在的自承载引擎配置。相关信息,请参阅 第 5.2 节 “从自承载引擎环境中删除一个主机”。
过程 7.1. 添加额外的自承载引擎主机
- 在管理门户中点主机资源标签页。
- 点。如需了解其它主机的设置,请参阅管理指南中的 Explanation of Settings and Controls in the New Host and Edit Host Windows。
- 使用数据中心和主机集群下拉列表为这个新主机选择数据中心和主机集群。
- 输入新主机的名称和地址。标准的 SSH 端口(22)会被自动填充到 SSH 端口项中。
- 选择 Manager 用来访问这个主机的身份验证方法。
- 输入 root 用户的密码。
- 或者,如果需要使用公共密钥进行验证,把 SSH 公共密钥项中的密钥复制到主机的
/root/.ssh/authorized_keys文件中。
- 如果主机中有被支持的电源管理卡,则可以配置电源管理功能。相关信息,请参阅管理指南中的 Host Power Management Settings Explained。
- 点承载引擎子标签页。
- 选部署选项。
- 点 。
第 8 章 迁移数据库
8.1. 把自承载引擎数据库迁移到一个远程服务器数据库中
engine 数据库迁移到一个远程的数据库服务器。
pg_dump 和 pg_restore 命令来处理数据库的备份和恢复。编辑 /etc/ovirt-engine/engine.conf.d/10-setup-database.conf 文件来包括更新的信息,最少需要更新新数据库服务器的位置信息。如果新数据库服务器中的数据库名称、角色名称或密码也有变化,这些信息也需要在 10-setup-database.conf 文件中进行相应的更新。在这里介绍的步骤中,为了尽量简化对这些文件的修改,我们使用了默认的 engine 数据库设置。
过程 8.1. 为 Red Hat Virtualization Manager 准备远程 PostgreSQL 数据库
- 登录到远程数据库服务器并安装 PostgreSQL server 软件包:
# yum install postgresql-server
- 初始化 PostgreSQL 数据库,启动
postgresql服务,把它设置为在系统引导时被自动启动:# service postgresql initdb # service postgresql start # chkconfig postgresql on
- 使用
postgres用户连接到 psql 命令行界面:# su - postgres $ psql
- 为 Manager 读写数据库创建一个用户。Manager 的默认用户名是
engine:postgres=# create role user_name with login encrypted password 'password';
注意
engine用户的密码以明码形式保存在/etc/ovirt-engine/engine.conf.d/10-setup-database.conf文件中。在新服务器上创建的角色可以使用任何密码,但如果新密码和保存在这个文件中的密码不同,则需要修改这个文件中的密码。 - 创建一个用来保存 Red Hat 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';
- 启用 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
- 允许 TCP/IP 到数据库的连接。编辑
/var/lib/pgsql/data/postgresql.conf文件,添加以下行:listen_addresses='*'
在这个例子中,postgresql服务被配置为监听所有接口上的连接。您可以使用 IP 地址来指定只监听特定接口上的连接。 - 打开 PostgreSQL 数据库连接所使用的默认端口,保存更新的防火墙规则:
# iptables -I INPUT 5 -p tcp --dport 5432 -j ACCEPT # service iptables save
- 重启
postgresql服务:# service postgresql restart
过程 8.2. 迁移数据库
- 登录到任何一个运行引擎的主机,把环境设置为
global维护模式。这会禁用高可用性代理,并防止在进行数据库迁移过程中出现 Manager 迁移的情况:# hosted-engine --set-maintenance --mode=global
- 登录到 Manager 虚拟机,停止
ovirt-engine服务,从而使它不会影响到引擎的备份:# service ovirt-engine stop
- 使用 PostgreSQL 的
pg_dump命令创建engine数据库的备份:# su - postgres -c 'pg_dump -F c engine -f /tmp/engine.dump'
- 把备份文件复制到新的数据库中。目标目录需要允许
postgres用户对它的访问:# scp /tmp/engine.dump root@new.database.server.com:/tmp/engine.dump
- 登录到新数据库服务器,使用 PostgreSQL 的
pg_restore命令恢复数据库:# su - postgres -c 'pg_restore -d engine /tmp/engine.dump'
- 登录到 Manager 虚拟机,更新
/etc/ovirt-engine/engine.conf.d/10-setup-database.conf文件中的设置。使用新数据库服务器的 IP 地址替换ENGINE_DB_HOST的localhost。如果新数据库服务器的引擎名称、角色名称或密码也有变化,则还需修改这个文件中的相应值。 - 现在,数据库已被迁移,启动
ovirt-engine服务:# service ovirt-engine start
- 登录到运行引擎的主机,关闭维护模式,启用高可用性代理:
# hosted-engine --set-maintenance --mode=none
8.2. 把 Data Warehouse 迁移到一个独立的机器上
ovirt_engine_history 数据库进行连接;或在迁移 Data Warehouse 服务前,把 ovirt_engine_history 数据库迁移到一个新的数据库机器上。如果 ovirt_engine_history 数据库原来存在于 Manager 所在的机器上,迁移 Data Warehouse 服务的同时迁移这个数据库,可以进一步减轻 Manager 所在机器的负载。您可以把数据库迁移到 Data Warehouse 服务所在的机器上,也可以把它迁移到一个完全独立的机器上。
8.3. 把 Data Warehouse 数据库迁移到一个独立的机器上
ovirt_engine_history 数据库。使用 pg_dump 命令创建一个数据库备份,再使用 psql 命令在新数据库中恢复数据库备份。pg_dump 命令提供了一组灵活的备份和恢复数据库的选项,如需了解相关信息,请参阅 pg_dump 的 man 页。
过程 8.3. 把 Data Warehouse 数据库迁移到一个独立的机器上
- 在当前的数据库所在机器上,把
ovirt_engine_history数据库输出到一个 SQL 脚本文件中:# pg_dump ovirt_engine_history > ovirt_engine_history.sql
- 把这个脚本文件从当前数据库所在的机器复制到新数据库所在的机器上。
- 在新数据库所在机器上恢复
ovirt_engine_history数据库:# psql -d ovirt_engine_history -f ovirt_engine_history.sql
以上命令假设新数据库已被命名为ovirt_engine_history。
8.4. 把 Data Warehouse 服务迁移到一个独立的机器上
ovirt_engine_history 数据库),请参阅 第 8.3 节 “把 Data Warehouse 数据库迁移到一个独立的机器上”。
- 设置新的 Data Warehouse 机器。
- 在 Manager 所在的机器上停止 Data Warehouse 服务。
- 配置新的 Data Warehouse 机器。
- 从 Manager 所在的机器上删除 Data Warehouse 软件包。
请确认您已经满足了以下前提条件。
- 已在同一台机器上安装并配置了 Manager 和 Data Warehouse。
- 为了设置新的 Data Warehouse 机器,您需要:
- 安装了 Red Hat Enterprise Linux 7 的虚拟机或物理机。
- 订阅了
Red Hat Enterprise Linux Server和Red Hat 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 机器
- 在 Content Delivery Network 中注册您的系统,在出现提示时输入您的客户门户网站的用户名和密码:
# subscription-manager register
- 找到
Red Hat Enterprise Linux Server和Red Hat Virtualization订阅池,并记录下它们的 ID。# subscription-manager list --available
- 使用前一步获得的池 ID 为系统附加权利:
# subscription-manager attach --pool=pool_id
- 禁用所有存在的软件仓库:
# subscription-manager repos --disable=*
- 启用所需的频道:
# subscription-manager repos --enable=rhel-7-server-rpms # subscription-manager repos --enable=rhel-7-server-supplementary-rpms # subscription-manager repos --enable=rhel-7-server-rhv-4.0-rpms # subscription-manager repos --enable=jb-eap-7-for-rhel-7-server-rpms
- 确认当前安装的软件包已被升级到最新版本:
# yum update
- 安装 ovirt-engine-dwh-setup 软件包:
# yum install ovirt-engine-dwh-setup
过程 8.5. 第 2 步:在 Manager 的机器上停止 Data Warehouse 服务
- 停止 Data Warehouse 服务:
# service ovirt-engine-dwhd stop
- 如果
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 Virtualization Manager 进行了全新设置,则相关的访问权限会被默认设置。 - 重启 postgresql 服务:
# service postgresql restart
过程 8.6. 第 3 步:配置新的 Data Warehouse 机器
- 运行
engine-setup命令在机器上开始配置 Data Warehouse:# engine-setup
- 点 Enter 配置 Data Warehouse:
Configure Data Warehouse on this host (Yes, No) [Yes]:
- 点 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。 - 点 Enter 接受自动检测到的主机名,或输入一个其它主机名后点 Enter:
Host fully qualified DNS name of this server [autodetected host name]:
- 输入
ovirt_engine_history数据库的以下位置信息:Where is the DWH database located? (Local, Remote) [Local]: Remote
输入您的选择后点 Enter。 - 输入
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
- 输入 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
- 点 Enter 为已存在的 Data Warehouse 数据库创建一个备份:
Would you like to backup the existing database before upgrading it? (Yes, No) [Yes]:
创建备份所需的时间和存储空间取决于数据库的大小,它可能会需要几个小时来完成。备份文件的位置出现在设置脚本的后面。如果您在这一步没有选择备份数据库,当因为某些原因engine-setup运行失败,您将无法恢复数据库或其中的任何数据。 - 确认您将永久地把 Data Warehouse 服务与 Manager 断开:
Do you want to permanently disconnect this DWH from the engine? (Yes, No) [No]:
- 确认您的安装设置:
Please confirm installation settings (OK, Cancel) [OK]:
过程 8.7. 第 4 步:在 Manager 的机器上删除 Data Warehouse 软件包
- 删除 Data Warehouse 软件包:
# yum remove ovirt-engine-dwh
这一步会防止 Data Warehouse 服务在一个小时后自动重启。 - 删除 Data Warehouse 文件:
# rm -rf /etc/ovirt-engine-dwh /var/lib/ovirt-engine-dwh
第 9 章 Data Warehouse
9.1. 配置 Data Warehouse
ovirt_engine_history 数据库会被创建,Manager 将使用这个数据库记录日志信息,并为报表服务提供数据。Data Warehouse 组件是可选的,用户需要单独安装并配置它们。
ovirt_engine_history 数据库需要使用的空间和资源。它是根据数据库中所包括的项的数量,以及数据需要被保存的时间来进行估算的。
9.2. Data Warehouse 配置备注
engine-setup 命令有以下问题:
engine-setup,在被提问是否配置 Data Warehouse 时回答 No:
Configure Data Warehouse on this host (Yes, No) [Yes]: No
engine-setup 命令时,配置这些服务的选项将不再被显示。
要强制 engine-setup 再次显示所有的选项,运行 engine-setup --reconfigure-optional-components。
注意
--offline 选项。
