Ce contenu n'est pas disponible dans la langue sélectionnée.
16.2. Migrating Red Hat Virtualization Databases to Remote Servers
16.2.1. Migrating the Manager Database to a Remote Server Copier lienLien copié sur presse-papiers!
You can migrate the Manager (engine) database to a remote database server after the Red Hat Virtualization Manager has been initially configured. Use engine-backup to create a database backup and restore it on the new database server.
The new database server must have Red Hat Enterprise Linux 7 installed and the required repositories enabled:
16.2.1.1. Enabling the Red Hat Virtualization Manager Repositories Copier lienLien copié sur presse-papiers!
Register the system with Red Hat Subscription Manager, attach the Red Hat Virtualization Manager subscription, and enable Manager repositories.
Procedure
Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted:
subscription-manager register
# subscription-manager registerCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you are using an IPv6 network, use an IPv6 transition mechanism to access the Content Delivery Network and subscription manager.
Find the
Red Hat Virtualization Managersubscription pool and record the pool ID:subscription-manager list --available
# subscription-manager list --availableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the pool ID to attach the subscription to the system:
subscription-manager attach --pool=pool_id
# subscription-manager attach --pool=pool_idCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteTo view currently attached subscriptions:
subscription-manager list --consumed
# subscription-manager list --consumedCopy to Clipboard Copied! Toggle word wrap Toggle overflow To list all enabled repositories:
yum repolist
# yum repolistCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the repositories:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Migrating the Manager Database to a Remote Server
Log in to the Red Hat Virtualization Manager machine and stop the
ovirt-engineservice so that it does not interfere with the engine backup:systemctl stop ovirt-engine.service
# systemctl stop ovirt-engine.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
enginedatabase backup:engine-backup --scope=files --scope=db --mode=backup --file=file_name --log=log_file_name
# engine-backup --scope=files --scope=db --mode=backup --file=file_name --log=log_file_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the backup file to the new database server:
scp /tmp/engine.dump root@new.database.server.com:/tmp
# scp /tmp/engine.dump root@new.database.server.com:/tmpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the new database server and install
engine-backup:yum install ovirt-engine-tools-backup
# yum install ovirt-engine-tools-backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restore the database on the new database server. file_name is the backup file copied from the Manager.
engine-backup --mode=restore --scope=files --scope=db --file=file_name --log=log_file_name --provision-db --no-restore-permissions
# engine-backup --mode=restore --scope=files --scope=db --file=file_name --log=log_file_name --provision-db --no-restore-permissionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Now that the database has been migrated, start the
ovirt-engineservice:systemctl start ovirt-engine.service
# systemctl start ovirt-engine.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
16.2.2. Migrating the Self-Hosted Engine Database to a Remote Server Copier lienLien copié sur presse-papiers!
You can migrate the engine database of a self-hosted engine to a remote database server after the Red Hat Virtualization Manager has been initially configured. Use engine-backup to create a database backup and restore it on the new database server.
The new database server must have Red Hat Enterprise Linux 7 installed and the required repositories enabled:
Enabling the Red Hat Virtualization Manager Repositories
Register the system with Red Hat Subscription Manager, attach the Red Hat Virtualization Manager subscription, and enable Manager repositories.
Procedure
Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted:
subscription-manager register
# subscription-manager registerCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you are using an IPv6 network, use an IPv6 transition mechanism to access the Content Delivery Network and subscription manager.
Find the
Red Hat Virtualization Managersubscription pool and record the pool ID:subscription-manager list --available
# subscription-manager list --availableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the pool ID to attach the subscription to the system:
subscription-manager attach --pool=pool_id
# subscription-manager attach --pool=pool_idCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteTo view currently attached subscriptions:
subscription-manager list --consumed
# subscription-manager list --consumedCopy to Clipboard Copied! Toggle word wrap Toggle overflow To list all enabled repositories:
yum repolist
# yum repolistCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the repositories:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Migrating the Self-Hosted Engine Database to a Remote Server
Log in to a self-hosted engine node and place the environment into
globalmaintenance mode. This disables the High Availability agents and prevents the Manager virtual machine from being migrated during the procedure:hosted-engine --set-maintenance --mode=global
# hosted-engine --set-maintenance --mode=globalCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the Red Hat Virtualization Manager machine and stop the
ovirt-engineservice so that it does not interfere with the engine backup:systemctl stop ovirt-engine.service
# systemctl stop ovirt-engine.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
enginedatabase backup:engine-backup --scope=files --scope=db --mode=backup --file=file_name --log=backup_log_name
# engine-backup --scope=files --scope=db --mode=backup --file=file_name --log=backup_log_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the backup file to the new database server:
scp /tmp/engine.dump root@new.database.server.com:/tmp
# scp /tmp/engine.dump root@new.database.server.com:/tmpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the new database server and install
engine-backup:yum install ovirt-engine-tools-backup
# yum install ovirt-engine-tools-backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restore the database on the new database server. file_name is the backup file copied from the Manager.
engine-backup --mode=restore --scope=files --scope=db --file=file_name --log=restore_log_name --provision-db --no-restore-permissions
# engine-backup --mode=restore --scope=files --scope=db --file=file_name --log=restore_log_name --provision-db --no-restore-permissionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Now that the database has been migrated, start the
ovirt-engineservice:systemctl start ovirt-engine.service
# systemctl start ovirt-engine.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to a self-hosted engine node and turn off maintenance mode, enabling the High Availability agents:
hosted-engine --set-maintenance --mode=none
# hosted-engine --set-maintenance --mode=noneCopy to Clipboard Copied! Toggle word wrap Toggle overflow
16.2.3. Migrating Data Warehouse to a Separate Machine Copier lienLien copié sur presse-papiers!
This section describes how to migrate the Data Warehouse database and service from the Red Hat Virtualization Manager to a separate machine. Hosting the Data Warehouse service on a separate machine reduces the load on each individual machine, and allows each service to avoid potential conflicts caused by sharing CPU and memory resources with other processes.
You can migrate the Data Warehouse service and connect it with the existing Data Warehouse database (ovirt_engine_history), or you can migrate the Data Warehouse database to the separate machine before migrating the Data Warehouse service. If the Data Warehouse database is hosted on the Manager, migrating the database in addition to the Data Warehouse service further reduces the competition for resources on the Manager machine. You can migrate the database to the same machine onto which you will migrate the Data Warehouse service, or to a machine that is separate from both the Manager machine and the new Data Warehouse service machine.
16.2.3.1. Migrating the Data Warehouse Database to a Separate Machine Copier lienLien copié sur presse-papiers!
Migrate the Data Warehouse database (ovirt_engine_history) before you migrate the Data Warehouse service. Use engine-backup to create a database backup and restore it on the new database machine. For more information on engine-backup, run engine-backup --help.
To migrate the Data Warehouse service only, see Section 16.2.3.2, “Migrating the Data Warehouse Service to a Separate Machine”.
The new database server must have Red Hat Enterprise Linux 7 installed. Enable the required repositories on the new database server.
Enabling the Red Hat Virtualization Manager Repositories
Register the system with Red Hat Subscription Manager, attach the Red Hat Virtualization Manager subscription, and enable Manager repositories.
Procedure
Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted:
subscription-manager register
# subscription-manager registerCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you are using an IPv6 network, use an IPv6 transition mechanism to access the Content Delivery Network and subscription manager.
Find the
Red Hat Virtualization Managersubscription pool and record the pool ID:subscription-manager list --available
# subscription-manager list --availableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the pool ID to attach the subscription to the system:
subscription-manager attach --pool=pool_id
# subscription-manager attach --pool=pool_idCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteTo view currently attached subscriptions:
subscription-manager list --consumed
# subscription-manager list --consumedCopy to Clipboard Copied! Toggle word wrap Toggle overflow To list all enabled repositories:
yum repolist
# yum repolistCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the repositories:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Migrating the Data Warehouse Database to a Separate Machine
Create a backup of the Data Warehouse database and configuration files on the Manager:
engine-backup --mode=backup --scope=dwhdb --scope=files --file=file_name --log=log_file_name
# engine-backup --mode=backup --scope=dwhdb --scope=files --file=file_name --log=log_file_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the backup file from the Manager to the new machine:
scp /tmp/file_name root@new.dwh.server.com:/tmp
# scp /tmp/file_name root@new.dwh.server.com:/tmpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install
engine-backupon the new machine:yum install ovirt-engine-tools-backup
# yum install ovirt-engine-tools-backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the PostgreSQL server package:
yum install rh-postgresql10 rh-postgresql10-postgresql-contrib
# yum install rh-postgresql10 rh-postgresql10-postgresql-contribCopy to Clipboard Copied! Toggle word wrap Toggle overflow Initialize the PostgreSQL database, start the
postgresqlservice, and ensure that this service starts on boot:scl enable rh-postgresql10 -- postgresql-setup --initdb systemctl enable rh-postgresql10-postgresql systemctl start rh-postgresql10-postgresql
# scl enable rh-postgresql10 -- postgresql-setup --initdb # systemctl enable rh-postgresql10-postgresql # systemctl start rh-postgresql10-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restore the Data Warehouse database on the new machine. file_name is the backup file copied from the Manager.
engine-backup --mode=restore --scope=files --scope=dwhdb --file=file_name --log=log_file_name --provision-dwh-db --no-restore-permissions
# engine-backup --mode=restore --scope=files --scope=dwhdb --file=file_name --log=log_file_name --provision-dwh-db --no-restore-permissionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The Data Warehouse database is now hosted on a separate machine from that on which the Manager is hosted. After successfully restoring the Data Warehouse database, a prompt instructs you to run the engine-setup command. Before running this command, migrate the Data Warehouse service.
16.2.3.2. Migrating the Data Warehouse Service to a Separate Machine Copier lienLien copié sur presse-papiers!
You can migrate the Data Warehouse service installed and configured on the Red Hat Virtualization Manager to a separate machine. Hosting the Data Warehouse service on a separate machine helps to reduce the load on the Manager machine.
Notice that this procedure migrates the Data Warehouse service only.
To migrate the Data Warehouse database (ovirt_engine_history) prior to migrating the Data Warehouse service, see Section 16.2.3.1, “Migrating the Data Warehouse Database to a Separate Machine”.
Prerequisites
- You must have installed and configured the Manager and Data Warehouse on the same machine.
To set up the new Data Warehouse machine, you must have the following:
- The password from the Manager’s /etc/ovirt-engine/engine.conf.d/10-setup-database.conf file.
- Allowed access from the Data Warehouse machine to the Manager database machine’s TCP port 5432.
-
The username and password for the Data Warehouse database from the Manager’s /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf file. If you migrated the
ovirt_engine_historydatabase using Section 16.2.3.1, “Migrating the Data Warehouse Database to a Separate Machine”, the backup includes these credentials, which you defined during the database setup on that machine.
Installing this scenario requires four steps:
16.2.3.2.1. Setting up the New Data Warehouse Machine Copier lienLien copié sur presse-papiers!
Enable the Red Hat Virtualization repositories and install the Data Warehouse setup package on a Red Hat Enterprise Linux 7 machine:
Enable the required repositories:
Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted:
subscription-manager register
# subscription-manager registerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Find the
Red Hat Virtualization Managersubscription pool and record the pool ID:subscription-manager list --available
# subscription-manager list --availableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the pool ID to attach the subscription to the system:
subscription-manager attach --pool=pool_id
# subscription-manager attach --pool=pool_idCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the repositories:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Ensure that all packages currently installed are up to date:
yum update
# yum updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
ovirt-engine-dwh-setuppackage:yum install ovirt-engine-dwh-setup
# yum install ovirt-engine-dwh-setupCopy to Clipboard Copied! Toggle word wrap Toggle overflow
16.2.3.2.2. Stopping the Data Warehouse Service on the Manager Machine Copier lienLien copié sur presse-papiers!
Stop the Data Warehouse service:
systemctl stop ovirt-engine-dwhd.service
# systemctl stop ovirt-engine-dwhd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the database is hosted on a remote machine, you must manually grant access by editing the postgres.conf file. Edit the /var/opt/rh/rh-postgresql10/lib/pgsql/data/postgresql.conf file and modify the listen_addresses line so that it matches the following:
listen_addresses = '*'
listen_addresses = '*'Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the line does not exist or has been commented out, add it manually.
If the database is hosted on the Manager machine and was configured during a clean setup of the Red Hat Virtualization Manager, access is granted by default.
See Section 16.2.3.1, “Migrating the Data Warehouse Database to a Separate Machine” for more information on how to configure and migrate the Data Warehouse database.
Restart the postgresql service:
systemctl restart rh-postgresql10-postgresql
# systemctl restart rh-postgresql10-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
16.2.3.2.3. Configuring the New Data Warehouse Machine Copier lienLien copié sur presse-papiers!
The order of the options or settings shown in this section may differ depending on your environment.
If you are migrating both the
ovirt_engine_historydatabase and the Data Warehouse service to the same machine, run the following, otherwise proceed to the next step.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
engine-setupcommand to begin configuration of Data Warehouse on the machine:engine-setup
# engine-setupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Press
Enterto configure Data Warehouse:Configure Data Warehouse on this host (Yes, No) [Yes]:
Configure Data Warehouse on this host (Yes, No) [Yes]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Press Enter to accept the automatically detected host name, or enter an alternative host name and press Enter:
Host fully qualified DNS name of this server [autodetected host name]:
Host fully qualified DNS name of this server [autodetected host name]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Press
Enterto automatically configure the firewall, or typeNoand pressEnterto maintain existing settings: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]:
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]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you choose to automatically configure the firewall, and no firewall managers are active, you are prompted to select your chosen firewall manager from a list of supported options. Type the name of the firewall manager and press
Enter. This applies even in cases where only one option is listed.Enter the fully qualified domain name and password for the Manager. Press Enter to accept the default values in each other field:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the FQDN and password for the Manager database machine. Press
Enterto accept the default values in each other field:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm your installation settings:
Please confirm installation settings (OK, Cancel) [OK]:
Please confirm installation settings (OK, Cancel) [OK]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The Data Warehouse service is now configured on the remote machine. Proceed to disable the Data Warehouse service on the Manager machine.
16.2.3.2.4. Disabling the Data Warehouse Service on the Manager Machine Copier lienLien copié sur presse-papiers!
On the Manager machine, restart the Manager:
service ovirt-engine restart
# service ovirt-engine restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to modify the file /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf and set the options to
False:sed -i \ -e 's;^\(OVESETUP_DWH_CORE/enable=bool\):True;\1:False;' \ -e 's;^\(OVESETUP_DWH_CONFIG/remoteEngineConfigured=bool\):True;\1:False;' \ /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf# sed -i \ -e 's;^\(OVESETUP_DWH_CORE/enable=bool\):True;\1:False;' \ -e 's;^\(OVESETUP_DWH_CONFIG/remoteEngineConfigured=bool\):True;\1:False;' \ /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow Disable the Data Warehouse service:
systemctl disable ovirt-engine-dwhd.service
# systemctl disable ovirt-engine-dwhd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the Data Warehouse files:
rm -f /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/* .conf /var/lib/ovirt-engine-dwh/backups/*
# rm -f /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/* .conf /var/lib/ovirt-engine-dwh/backups/*Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The Data Warehouse service is now hosted on a separate machine from the Manager.