Appendix C. Migrating Databases and Services to a Remote Server
Although you cannot configure remote databases and services during the automated installation, you can migrate them to a separate server post-installation.
C.1. Migrating the Data Warehouse to a Separate Machine
This section describes how to migrate the Data Warehouse database and service from the Red Hat Virtualization Manager machine to a separate machine. Hosting the Data Warehouse service on a separate machine reduces the load on each individual machine, and avoids potential conflicts caused by sharing CPU and memory resources with other processes.
Red Hat only supports installing the Data Warehouse database, the Data Warehouse service and Grafana all on the same machine as each other, even though you can install each of these components on separate machines from each other.
You have the following migration options:
-
You can migrate the Data Warehouse service away from the Manager machine and connect it with the existing Data Warehouse database (
ovirt_engine_history
). - You can migrate the Data Warehouse database away from the Manager machine and then migrate the Data Warehouse service.
C.1.1. Migrating the Data Warehouse Database to a Separate Machine
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
.
Red Hat only supports installing the Data Warehouse database, the Data Warehouse service and Grafana all on the same machine as each other, even though you can install each of these components on separate machines from each other.
The new database server must have Red Hat Enterprise Linux 8 installed.
Enable the required repositories on the new database server.
C.1.1.1. Enabling the Red Hat Virtualization Manager Repositories
You need to log in and register the Data Warehouse machine with Red Hat Subscription Manager, attach the Red Hat Virtualization Manager
subscription, and enable the Manager repositories.
Procedure
Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager register
# subscription-manager register
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 Manager
subscription pool and record the pool ID:Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager list --available
# subscription-manager list --available
Use the pool ID to attach the subscription to the system:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager attach --pool=pool_id
# subscription-manager attach --pool=pool_id
NoteTo view currently attached subscriptions:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager list --consumed
# subscription-manager list --consumed
To list all enabled repositories:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf repolist
# dnf repolist
Configure the repositories:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager repos \ --disable='*' \ --enable=rhel-8-for-x86_64-baseos-eus-rpms \ --enable=rhel-8-for-x86_64-appstream-eus-rpms \ --enable=rhv-4.4-manager-for-rhel-8-x86_64-rpms \ --enable=fast-datapath-for-rhel-8-x86_64-rpms \ --enable=jb-eap-7.4-for-rhel-8-x86_64-rpms \ --enable=openstack-16.2-cinderlib-for-rhel-8-x86_64-rpms \ --enable=rhceph-4-tools-for-rhel-8-x86_64-rpms \ --enable=rhel-8-for-x86_64-appstream-tus-rpms \ --enable=rhel-8-for-x86_64-baseos-tus-rpms
# subscription-manager repos \ --disable='*' \ --enable=rhel-8-for-x86_64-baseos-eus-rpms \ --enable=rhel-8-for-x86_64-appstream-eus-rpms \ --enable=rhv-4.4-manager-for-rhel-8-x86_64-rpms \ --enable=fast-datapath-for-rhel-8-x86_64-rpms \ --enable=jb-eap-7.4-for-rhel-8-x86_64-rpms \ --enable=openstack-16.2-cinderlib-for-rhel-8-x86_64-rpms \ --enable=rhceph-4-tools-for-rhel-8-x86_64-rpms \ --enable=rhel-8-for-x86_64-appstream-tus-rpms \ --enable=rhel-8-for-x86_64-baseos-tus-rpms
Set the RHEL version to 8.6:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager release --set=8.6
# subscription-manager release --set=8.6
Enable version 12 of the
postgresql
module.Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf module -y enable postgresql:12
# dnf module -y enable postgresql:12
Enable version 14 of the
nodejs
module:Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf module -y enable nodejs:14
# dnf module -y enable nodejs:14
- Update the Self-Hosted Engine using the procedure Updating a Self-Hosted Engine in the Upgrade Guide.
Additional resources
For information on modules and module streams, see the following sections in Installing, managing, and removing user-space components
C.1.1.2. Migrating the Data Warehouse Database to a Separate Machine
Procedure
Create a backup of the Data Warehouse database and configuration files on the Manager:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow engine-backup --mode=backup --scope=grafanadb --scope=dwhdb --scope=files --file=file_name --log=log_file_name
# engine-backup --mode=backup --scope=grafanadb --scope=dwhdb --scope=files --file=file_name --log=log_file_name
Copy the backup file from the Manager to the new machine:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow scp /tmp/file_name root@new.dwh.server.com:/tmp
# scp /tmp/file_name root@new.dwh.server.com:/tmp
Install
engine-backup
on the new machine:Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf install ovirt-engine-tools-backup
# dnf install ovirt-engine-tools-backup
Install the PostgreSQL server package:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf install postgresql-server postgresql-contrib
# dnf install postgresql-server postgresql-contrib
Initialize the PostgreSQL database, start the
postgresql
service, and ensure that this service starts on boot:Copy to Clipboard Copied! Toggle word wrap Toggle overflow su - postgres -c 'initdb' systemctl enable postgresql systemctl start postgresql
# su - postgres -c 'initdb' # systemctl enable postgresql # systemctl start postgresql
Restore the Data Warehouse database on the new machine. file_name is the backup file copied from the Manager.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow engine-backup --mode=restore --scope=files --scope=grafanadb --scope=dwhdb --file=file_name --log=log_file_name --provision-dwh-db
# engine-backup --mode=restore --scope=files --scope=grafanadb --scope=dwhdb --file=file_name --log=log_file_name --provision-dwh-db
When the
--provision-*
option is used in restore mode,--restore-permissions
is applied by default.
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.
C.1.2. Migrating the Data Warehouse Service to a Separate Machine
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 Migrating the Data Warehouse Database to a Separate Machine.
Red Hat only supports installing the Data Warehouse database, the Data Warehouse service and Grafana all on the same machine as each other, even though you can install each of these components on separate machines from each other.
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_history
database using the procedures described in 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:
- Setting up the New Data Warehouse Machine
- Stopping the Data Warehouse service on the Manager machine
- Configuring the new Data Warehouse machine
- Disabling the Data Warehouse package on the Manager machine
C.1.2.1. Setting up the New Data Warehouse Machine
Enable the Red Hat Virtualization repositories and install the Data Warehouse setup package on a Red Hat Enterprise Linux 8 machine:
Enable the required repositories:
Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager register
# subscription-manager register
Find the
Red Hat Virtualization Manager
subscription pool and record the pool ID:Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager list --available
# subscription-manager list --available
Use the pool ID to attach the subscription to the system:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager attach --pool=pool_id
# subscription-manager attach --pool=pool_id
Configure the repositories:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription-manager repos \ --disable='*' \ --enable=rhel-8-for-x86_64-baseos-eus-rpms \ --enable=rhel-8-for-x86_64-appstream-eus-rpms \ --enable=rhv-4.4-manager-for-rhel-8-x86_64-rpms \ --enable=fast-datapath-for-rhel-8-x86_64-rpms \ --enable=jb-eap-7.4-for-rhel-8-x86_64-rpms subscription-manager release --set=8.6
# subscription-manager repos \ --disable='*' \ --enable=rhel-8-for-x86_64-baseos-eus-rpms \ --enable=rhel-8-for-x86_64-appstream-eus-rpms \ --enable=rhv-4.4-manager-for-rhel-8-x86_64-rpms \ --enable=fast-datapath-for-rhel-8-x86_64-rpms \ --enable=jb-eap-7.4-for-rhel-8-x86_64-rpms # subscription-manager release --set=8.6
Enable the
pki-deps
module.Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf module -y enable pki-deps
# dnf module -y enable pki-deps
Ensure that all packages currently installed are up to date:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf upgrade --nobest
# dnf upgrade --nobest
Install the
ovirt-engine-dwh-setup
package:Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf install ovirt-engine-dwh-setup
# dnf install ovirt-engine-dwh-setup
C.1.2.2. Stopping the Data Warehouse Service on the Manager Machine
Procedure
Stop the Data Warehouse service:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl stop ovirt-engine-dwhd.service
# systemctl stop ovirt-engine-dwhd.service
If the database is hosted on a remote machine, you must manually grant access by editing the postgres.conf file. Edit the
/var/lib/pgsql/data/postgresql.conf
file and modify the listen_addresses line so that it matches the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow listen_addresses = '*'
listen_addresses = '*'
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.
Restart the postgresql service:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl restart postgresql
# systemctl restart postgresql
C.1.2.3. Configuring the New Data Warehouse Machine
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_history
database 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 sed -i '/^ENGINE_DB_/d' \ /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf sed -i \ -e 's;^\(OVESETUP_ENGINE_CORE/enable=bool\):True;\1:False;' \ -e '/^OVESETUP_CONFIG\/fqdn/d' \ /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf
# sed -i '/^ENGINE_DB_/d' \ /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf # sed -i \ -e 's;^\(OVESETUP_ENGINE_CORE/enable=bool\):True;\1:False;' \ -e '/^OVESETUP_CONFIG\/fqdn/d' \ /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf
Remove the apache/grafana PKI files, so that they are regenerated by
engine-setup
with correct values:Copy to Clipboard Copied! Toggle word wrap Toggle overflow rm -f \ /etc/pki/ovirt-engine/certs/apache.cer \ /etc/pki/ovirt-engine/certs/apache-grafana.cer \ /etc/pki/ovirt-engine/keys/apache.key.nopass \ /etc/pki/ovirt-engine/keys/apache-grafana.key.nopass \ /etc/pki/ovirt-engine/apache-ca.pem \ /etc/pki/ovirt-engine/apache-grafana-ca.pem
# rm -f \ /etc/pki/ovirt-engine/certs/apache.cer \ /etc/pki/ovirt-engine/certs/apache-grafana.cer \ /etc/pki/ovirt-engine/keys/apache.key.nopass \ /etc/pki/ovirt-engine/keys/apache-grafana.key.nopass \ /etc/pki/ovirt-engine/apache-ca.pem \ /etc/pki/ovirt-engine/apache-grafana-ca.pem
Run the
engine-setup
command to begin configuration of Data Warehouse on the machine:Copy to Clipboard Copied! Toggle word wrap Toggle overflow engine-setup
# engine-setup
Press Enter to accept the automatically detected host name, or enter an alternative host name and press Enter:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Host fully qualified DNS name of this server [autodetected host name]:
Host fully qualified DNS name of this server [autodetected host name]:
Press
Enter
to automatically configure the firewall, or typeNo
and pressEnter
to maintain existing settings:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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]:
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 Host fully qualified DNS name of the engine server []: engine-fqdn Setup needs to do some actions on the remote engine server. Either automatically, using ssh as root to access it, or you will be prompted to manually perform each such action. Please choose one of the following: 1 - Access remote engine server using ssh as root 2 - Perform each action manually, use files to copy content around (1, 2) [1]: ssh port on remote engine server [22]: root password on remote engine server engine-fqdn: password
Host fully qualified DNS name of the engine server []: engine-fqdn Setup needs to do some actions on the remote engine server. Either automatically, using ssh as root to access it, or you will be prompted to manually perform each such action. Please choose one of the following: 1 - Access remote engine server using ssh as root 2 - Perform each action manually, use files to copy content around (1, 2) [1]: ssh port on remote engine server [22]: root password on remote engine server engine-fqdn: password
Enter the FQDN and password for the Manager database machine. Press
Enter
to accept the default values in each other field:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Engine database host []: manager-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
Engine database host []: manager-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
Confirm your installation settings:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Please confirm installation settings (OK, Cancel) [OK]:
Please confirm installation settings (OK, Cancel) [OK]:
The Data Warehouse service is now configured on the remote machine. Proceed to disable the Data Warehouse service on the Manager machine.
C.1.2.4. Disabling the Data Warehouse Service on the Manager Machine
Prerequisites
The Grafana service on the Manager machine is disabled:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl disable --now grafana-server.service
# systemctl disable --now grafana-server.service
Procedure
On the Manager machine, restart the Manager:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow service ovirt-engine restart
# service ovirt-engine restart
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
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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_GRAFANA_CORE/enable=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.conf # sed -i \ -e 's;^\(OVESETUP_GRAFANA_CORE/enable=bool\):True;\1:False;' \ /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf
Disable the Data Warehouse service:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl disable ovirt-engine-dwhd.service
# systemctl disable ovirt-engine-dwhd.service
Remove the Data Warehouse files:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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/*
The Data Warehouse service is now hosted on a separate machine from the Manager.