Using DKMS on RHEL or CentOS to build ZST for other kernel versions

Please note: Since Azul Platform Prime 19.07 released in the year 2019, the ZST component is not a requirement any more on current operating system versions. Especially on modern Linux Kernel version of 4.14 or newer where Azul Platform Prime can use large virtual memory pages with the configuration described on https://docs.azul.com/prime/Enable-Huge-Pages, the ZST component is rarely needed.

DKMS in general solves the situation when the available ZST packages don't list your Linux Kernel Version as supported. For example if you use a custom kernel outside of the Operating System's official software repositories. In those situations, DKMS (Dynamic Kernel Module Support) then starts the ZST build process on your system. The following error message when starting the ZST system service zing-memory is showing a situation where the ZST package is not including support for the current system's kernel version and where DKMS could help:

# sudo service zing-memory restart
insmod: ERROR: could not insert module /lib/modules/zing-driver/extra/zing_mm.ko: Invalid parameters
zing-memory: ERROR: insmod /lib/modules/zing-driver/extra/zing_mm.ko failed (error 1)
zing-memory: INFO: Zing ZST support for kernel 3.8.13-118.14.2.el7.x86_64 is unavailable. Please upgrade ZST.

For most installations utilizing DKMS is not necessary and our non-DKMS packages available on http://www.azul.com/software-downloads-and-documents/ with the standard documentation at http://docs.azul.com/prime should be used.

An alternative to DKMS for those use cases where the Linux kernel is always upgraded to the most recent release of the OS vendor, is to attach the Azul Platform Prime software repository as described in https://docs.azul.com/prime/Installation-And-Configuration and thereby upgrading ZST automatically when the Linux kernel is upgraded on the system. The ZST software packages in the repository are currently updated every 24 hours in case a kernel update is released. Though for custom kernels, this approach won't work and DKMS is still the preferred solution then.

Please note that not all custom kernels work with ZST as ZST has certain requirements about the kernel configuration. For example as of December 2021, the kernel packages from elrepo.org won't work.

The dkms tool is already included in Ubuntu, SLES, Debian and Amazon Linux. On those systems it is sufficient to just install the ZST DKMS-based package from the download page listed above and you don't need to read further. For other systems, like CentOS, RHEL and Oracle Linux the dkms tool is not part of the operating system, but it can be installed from the EPEL (Extra Packages for Enterprise Linux) repository as described in the following steps.

Before starting with DKMS, make sure you can revert your system state by using a VM snapshot or system backup in case the installation fails.

The version numbers like 3.10.0-514, 5.16.0.0 and package names with version numbers on this page are just examples, you need to replace them with the actual versions of the current Linux and ZST version.

To add the dkms tool, these steps are necessary:

If you are using Oracle Linux, check if the Oracle Unbreakable Enterprise Kernel (UEK) is used or not:

The following output is an example for an UEK in use:
# uname -r
3.8.13-118.14.2.el7uek.x86_64

This is a non-UEK:
# uname -r
3.10.0-514.el7.x86_64

On Oracle UEK start with:
# sudo yum install kernel-uek-devel.x86_64

On RHEL, CentOS or Oracle non-UEK start with:
# sudo yum install "kernel-devel-uname-r == $(uname -r)"

The following process is the same for RHEL, CentOS and Oracle UEK/non-UEK.

If ZST was already installed in its non-DKMS version make a backup of its configuration and then remove the installed ZST:

# mkdir zst-config
# cp -v /etc/zing/pmem.conf.* zst-config
# sudo yum remove zing-zst

Now ZST for DKMS will be installed:

# sudo yum install yum-utils
# sudo curl -O https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# sudo yum clean metadata dbcache
# sudo yum install epel-release-latest-7.noarch.rpm
# sudo yum-config-manager --disable epel
# sudo yum --enablerepo=epel install dkms

Afterwards, please download the Azul Zulu Prime JVM RPM package and the Azul Zulu Prime System Tools DKMS RPM package from http://www.azul.com/software-downloads-and-documents/

Now those packages are installed:

# sudo yum install perl-Sys-Syslog.x86_64
# sudo yum localinstall zing-zst-7d.dkms.2.6.18-5.15.0.0.3.el.x86_64.rpm
# sudo yum localinstall zing-jdk1.8.0-16.01.7.0-6.x86_64.rpm

Now install the previously copied configuration and restart the Azul Zulu Prime system service:

# sudo cp zst-config/pmem.conf.* /etc/zing/
# sudo zing-memory restart

Afterwards, run the following commands to verify that ZST is completely installed and Azul Zulu Prime JVM is working:

# sudo service zing-memory status
# /opt/zing/zing-jdk8/bin/java -version 

On later Operating System updates triggered by rpm or yum, the dkms-based ZST will be rebuild automatically and no user interaction is necessary.

If for some reason, the dkms-based ZST has to be rebuild and reinstalled manually, please use the following commands, but replace the version numbers according to your system:

# sudo dkms status
zing_mm, 5.16.0.0-3, 4.4.0-53-generic, x86_64: installed
zing_mm, 5.16.0.0-3, 4.4.0-59-generic, x86_64: installed
# sudo dkms build zing_mm/5.16.0.0-3
# sudo dkms install zing_mm/5.16.0.0-3

In case the EPEL mirrors cannot be reached on later upgrades, please reinstall the EPEL.rpm to receive the updated mirrors list:

# sudo curl -O https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# sudo yum reinstall epel-release-latest-7.noarch.rpm

 

Add Comment

Comments

0 comments

Please sign in to leave a comment.

Was this article helpful?
1 out of 1 found this helpful