Skip to content

Alma ELevate

Rinocenc edited this page Mar 18, 2024 · 10 revisions

Summary: This document shows the process of upgrading from Centos 7 to Rocky 8 while using PostgreSQL 14 for Metadata indexing. By default, PostgreSQL is not used for metadata indexing. If PostgreSQL is not being used on your system, all PostgreSQL steps can be skipped. The commands within this document are being run as the root user.

Reference: https://wiki.almalinux.org/elevate/ELevate-quickstart-guide.html

The Preupgrade process

  1. Stop LOCKSS and PostgreSQL
# systemctl stop lockss
# systemctl stop postgresql-14
  1. Disable LOCKSS and PostgreSQL to keep them from restarting during a reboot (the system will restart several times during this process)
# systemctl disable lockss
# systemctl disable postgresql-14
  1. Update the system (system is currently Centos7)
# yum update -y

Important Note: If the LOCKSS Daemon was updated during the update process, you must stop the service again with systemctl stop lockss

  1. Install the Alma ELevate repository and the Alma ELevate packages. The first package being installed contains the binaries to run the upgrade process, and the second contains the metadata for Rocky 8
# yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
# yum install -y leapp-upgrade leapp-data-rocky
  1. Run the ELevate "preupgrade" script
# leapp preupgrade
  1. The preupgrade script will create a file which contains questions that need to be answered. The log may show additional questions that need to be answered, but the following answers are the most commonly needed.
# rmmod pata_acpi
# echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
# leapp answer --section remove_pam_pkcs11_module_check.confirm=True

The Upgrade

Important Note: If you are presented with multiple questions that the above commands do not satisfy, please refer to the FAQ at https://wiki.almalinux.org/elevate/ELevate-frequent-issues

  1. Run the upgrade script and reboot the system when it completes
# leapp upgrade
# reboot

Important Note: The system will boot into a new GRUB entry named ELevate-Upgrade-Initramfs. Upon booting, the upgrades will continue and may take several minutes to complete. You can only monitor the progress of this portion in the console. The system will automatically reboot after this completes

Fixing PostgreSQL and Completing Upgrade

  1. Gain root access, then disable native Rocky PostgreSQL module that comes with Rocky 8. We must disable the native Rocky module because it conflicts with the PostgreSQL repository from the PostgreSQL Group.
# dnf -y module disable postgresql
  1. Reinstall the PostgreSQL server and contrib packages (they do not survive the upgrade process). We are using PostgreSQL 14.
# dnf install -y postgresql14-server postgresql14-contrib
  1. If your original PostgreSQL data directory is installed in a non-standard location, rename the new /var/lib/pgsql directory, and then point your new PostgreSQL installation at it with a symbolic link. (our database lives under /cache0/)
# mv /var/lib/pgsql /var/lib/pgsql.14.orig
# ln -s /cache0/pgsql/ /var/lib/pgsql
  1. Enable and start PostgreSQL (MUST BE DONE BEFORE STARTING LOCKSS)
# systemctl enable postgresql-14
# systemctl start postgresql-14
  1. Enable and start LOCKSS
# systemctl enable lockss
# systemctl start lockss

Common Errors While Updating

Summary: Below are common errors that we experienced while upgrading from Centos 7 to Rocky 8. Our system is using PostgreSQL 14 for Metadata indexing. The commands within this document are being run as the root user.

Reference: https://wiki.almalinux.org/elevate/ELevate-quickstart-guide.html

  1. PostgreSQL repo errors when running the preupgrade process

The PostgreSQL repo has been updated and the GPG key has been changed. In order to fix this, we had to remove the old repo, and then reinstall it.

# rpm -qf /etc/yum.repos.d/pgdg-redhat-all.repo
  pgdg-redhat-repo-35.0-40PGDG.noarch
# yum remove pgdg-redhat-repo-35.0-40PGDG.noarch
# $ sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
  1. At least X MB more space needed on the filesystem

Error message reads

Error Summary
-------------
Disk Requirements:
   At least 1044MB more space needed on the / filesystem

To fix this error, we must increase a Leapp environment variable. It is best to increase the variable at a system level, instead of at a user level.

Add the following line to /etc/profile.d/local.sh

LEAPP_OVL_SIZE=3000

Restart current shell by signing out/in, or run "bash". Now re-run the upgrade and it should complete without throwing errors regarding space in the / partition

  1. System fails to boot after "successful" upgrade. System boots into recovery mode

If you are running a system that contains raid devices, you may need to comment out the mount points in /etc/fstab. There will be error messages regarding which storage devices "cannot be found", but it may be hard to find them in the console output. We had to comment/remove these mount points from /etc/fstab, gather information regarding the storage devices, and recreate the mount points in /etc/fstab.

  1. Specific Java packages not found during preupgrade process.

We had Java package installed that was not needed and was keeping the preupgrade process from completing. The package was javapackages-tools.noarch. To save time, I simply did the following

yum remove java*

After the upgrade, I replaced the openjdk packages with

dnf install java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel java-1.8.0-openjdk