Chapter 7. Upgrading a Remote Database Environment from 4.1 to Red Hat Virtualization 4.2
Upgrading your environment from 4.1 to 4.2 involves the following steps:
- Upgrade the database from PostgreSQL 9.2 to 9.5
- Update the 4.1 Manager to the latest version of 4.1
- Upgrade the Manager from 4.1 to 4.2
- Upgrade the hosts
- Update the compatibility version of the clusters
- Update the compatibility version of the data centers
- Replace SHA-1 certificates with SHA-256 certificates
- If you installed the technology preview version of Open Virtual Network (OVN) in 4.1, update the OVN provider’s networking plugin
7.1. Upgrading Remote Databases from PG 9.2 to 9.5 Copy linkLink copied to clipboard!
Red Hat Virtualization 4.2 uses PostgreSQL 9.5 instead of PostgreSQL 9.2. If your databases are installed locally, the upgrade script will automatically upgrade them from version 9.2 to 9.5, and you can skip this section and proceed to the next step. However, if either of your databases (Manager or Data Warehouse) is installed on a separate machine, you must perform the following procedure on each remote database before upgrading the Manager.
Stop the service running on the machine:
Stop the
ovirt-engine
service on the Manager machine:systemctl stop ovirt-engine
# systemctl stop ovirt-engine
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop the
ovirt-engine-dwh
service on the Data Warehouse machine:systemctl stop ovirt-engine-dwhd
# systemctl stop ovirt-engine-dwhd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Enable the required repository to receive the PostgreSQL 9.5 package:
Enable either the Red Hat Virtualization Manager repository:
subscription-manager repos --enable=rhel-7-server-rhv-4.2-manager-rpms
# subscription-manager repos --enable=rhel-7-server-rhv-4.2-manager-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow or the SCL repository:
subscription-manager repos --enable rhel-server-rhscl-7-rpms
# subscription-manager repos --enable rhel-server-rhscl-7-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the PostgreSQL 9.5 packages:
yum install rh-postgresql95 rh-postgresql95-postgresql-contrib
# yum install rh-postgresql95 rh-postgresql95-postgresql-contrib
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop and disable the PostgreSQL 9.2 service:
systemctl stop postgresql systemctl disable postgresql
# systemctl stop postgresql # systemctl disable postgresql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Upgrade the PostgreSQL 9.2 database to PostgreSQL 9.5:
scl enable rh-postgresql95 -- postgresql-setup upgrade
# scl enable rh-postgresql95 -- postgresql-setup upgrade
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the
rh-postgresql95-postgresql.service
and check that it is running:systemctl start rh-postgresql95-postgresql.service systemctl enable rh-postgresql95-postgresql.service systemctl status rh-postgresql95-postgresql.service
# systemctl start rh-postgresql95-postgresql.service # systemctl enable rh-postgresql95-postgresql.service # systemctl status rh-postgresql95-postgresql.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that you see an output similar to the following:
rh-postgresql95-postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/rh-postgresql95-postgresql.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2018-05-07 08:48:27 CEST; 1h 59min ago
rh-postgresql95-postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/rh-postgresql95-postgresql.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2018-05-07 08:48:27 CEST; 1h 59min ago
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the database and enable the
uuid-ossp
extension:su - postgres -c "scl enable rh-postgresql95 -- psql -d database-name"
# su - postgres -c "scl enable rh-postgresql95 -- psql -d database-name"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Execute the following SQL commands:
database-name=# DROP FUNCTION IF EXISTS uuid_generate_v1(); database-name=# CREATE EXTENSION "uuid-ossp";
# database-name=# DROP FUNCTION IF EXISTS uuid_generate_v1(); # database-name=# CREATE EXTENSION "uuid-ossp";
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the
pg_hba.conf
client configuration file from the 9.2 environment to your 9.5 environment:cp -p /var/lib/pgsql/data/pg_hba.conf /var/opt/rh/rh-postgresql95/lib/pgsql/data/pg_hba.conf
# cp -p /var/lib/pgsql/data/pg_hba.conf /var/opt/rh/rh-postgresql95/lib/pgsql/data/pg_hba.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the following parameters in the
postgresql.conf
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the PostgreSQL 9.5 service to apply the configuration changes:
systemctl restart rh-postgresql95-postgresql.service
# systemctl restart rh-postgresql95-postgresql.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The remote databases have been upgraded.