HOWTO: Upgrade RHEL 7 to RHEL 8

From Adpnwiki
Jump to navigation Jump to search

RHEL 7 to RHEL 8 Upgrade Process

The process for upgrading from RHEL 7 to RHEL 8 is fairly straight forward and simple, however, there are several steps that must be taken to prevent data loss.

First, we need to make sure that the system has an active subscription:

[zrbddac@lockss-adpn3 ~]$ sudo subscription-manager attach --auto

[All installed products are covered by valid entitlements. No need to update subscriptions at this time.

[Installed Product Current Status:

[Product Name: Red Hat Enterprise Linux Server

[Status: Subscribed

Next, verify the version that you are currently on. You should be on the most up to date version of RHEL 7:

[ [zrbddac@lockss-adpn3 ~]$ cat /etc/redhat-release

[Red Hat Enterprise Linux Server release 7.9 (Maipo)

[ [zrbddac@lockss-adpn3 ~]$

And make sure the system is fully up to date:

[sudo yum update && sudo yum upgrade

Now we need to install add the repos and install LEAP:

[sudo subscription-manager repos --enable rhel-7-server-extras-rpms

[sudo yum install leapp


Download the needed files from RedHat(Note that these files are updated regularly and this URL will likely be obsolete:

wget https://access.redhat.com/sites/default/files/attachments/leapp-data3.tar.gz

Extract these files to /etc/leap/files

Performing the upgrade:

Now, we are almost ready to perform the update.

Before starting the update, we will need to stop any service running. In this case 3 services we definitely want to stop are firewalld, lockss, and cisco-amp:

[sudo systemctl stop lockss

[sudo systemctl stop cisco-amp

[sudo systemctl stop firewalld

Now we can perform the actual upgrade:

[sudo leap upgrade –target 8.6

At this stage, the upgrade may fail and you may encounter several “Inhibitors” in the failure report.

The report will give you command solutions to most “Inhibitors” but it will be up to you and your team to determine if the application in question can be removed or replaced.

You may also see a failure that simply says the answerfile is missing, but no commands that need to be run. In this case, LEAPP has already generated an answerfile and you can run the upgrade again.

Auburn Specific Steps

Once the upgrade is complete, there are a few steps that need to be taken to get everything back to 100%.

First, go to /etc/yum.repos/ and edit the repo files to change them from 7 to 8. Note, do not make this change to the mysql repos if there are any.

Next, we will need to unset the RHEL version. This will prevent the possibility of RHEL getting version locked:

[ [zrbddac@lockss-adpn3 yum.repos.d]$ sudo subscription-manager release --unset

[Release preference has been unset

[ [zrbddac@lockss-adpn3 yum.repos.d]$ sudo yum clean all

[Updating Subscription Management repositories.

[135 files removed

[ [zrbddac@lockss-adpn3 yum.repos.d]$ sudo subscription-manager repos

[+----------------------------------------------------------+

[ Available Repositories in /etc/yum.repos.d/redhat.repo

[+----------------------------------------------------------+

[Repo ID: satellite-tools-6.5-for-rhel-8-x86_64-rpms

[Repo Name: Red Hat Satellite Tools 6.5 for RHEL 8 x86_64 (RPMs)

[Repo URL: https://phobos.auburn.edu/pulp/repos/OIT/Library/content/dist/layered/rhel8/x86_64/sat-tools/6.5/os

[Enabled: 1


[Repo ID: rhel-8-for-x86_64-supplementary-rpms

[Repo Name: Red Hat Enterprise Linux 8 for x86_64 - Supplementary (RPMs)

[Repo URL: https://phobos.auburn.edu/pulp/repos/OIT/Library/content/dist/rhel8/8.6/x86_64/supplementary/os

[Enabled: 0


[Repo ID: rhel-8-for-x86_64-appstream-rpms

[Repo Name: Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)

[Repo URL: https://phobos.auburn.edu/pulp/repos/OIT/Library/content/dist/rhel8/8.6/x86_64/appstream/os

[Enabled: 1


[Repo ID: OIT_AU_packages

[Repo Name: packages

[Repo URL: https://phobos.auburn.edu/pulp/repos/OIT/Library/custom/AU/packages

[Enabled: 0


[Repo ID: codeready-builder-for-rhel-8-x86_64-rpms

[Repo Name: Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)

[Repo URL: https://phobos.auburn.edu/pulp/repos/OIT/Library/content/dist/rhel8/8.6/x86_64/codeready-builder/os

[Enabled: 1


[Repo ID: rhel-8-for-x86_64-baseos-rpms

[Repo Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)

[Repo URL: https://phobos.auburn.edu/pulp/repos/OIT/Library/content/dist/rhel8/8.6/x86_64/baseos/os

[Enabled: 1

Now we need to install and configure Nagios:

First, run this command to install Nagios:

[sudo dnf install nagios-plugins-all nagios-plugins-bonding nagios-plugins-check-updates nagios-plugins-nrpe nrpe If this gives you errors about existing packages, run the command:

[sudo dnf install nagios-plugins-all nagios-plugins-bonding nagios-plugins-check-updates nagios-plugins-nrpe nrpe –allowerasing –nobest

Once everything is installed, run the following command to allow Nagios to communicate with the Nagios server:

[sudo touch /etc/nagios/nrpe.cfg

[sudo sed -i "s/allowed_hosts=127.0.0.1,::1/allowed_hosts=127.0.0.1,131.204.73.191/g" /etc/nagios/nrpe.cfg

[sudo sed -i 's#/etc/nrpe.d#/etc/nagios/nrpe.d#' /etc/nagios/nrpe.cfg

[sudo systemctl restart nrpe

Now edit /etc/sysconfig/nrpe and change the contents to:

[# specify additional command line arguments for nrpe

[NRPE_SSL_OPT="-n"

Next run these commands in /etc/nagios to correct false positive Nagios errors:

[sudo cp nrpe.cfg nrpe.cfg.bak

[sudo cp -v /etc/nagios/nrpe.cfg.rpmsave /etc/nagios/nrpe.cfg

[ls -lhZ /etc/nagios/nrpe.cfg


Finally, run:

[sudo systemctl restart nrpe

Now check Nagios and the checks should be working properly.