Upgrading the JDK
Cloudera Manager, Cloudera Runtime, and CDH require a supported version of the Java Development Kit (JDK) to be installed on all hosts. For details, see CDP Java Requirements.
Loading Filters ...
- Installing Java During an Upgrade
If you are upgrading to Cloudera Manager 6.0.0 or higher, you can manually install JDK 1.8 on the Cloudera Manager server host, and then, as part of the Cloudera Manager upgrade process, you can specify that Cloudera Manager upgrade the JDK on the remaining hosts.
- Manually Installing Oracle JDK 1.8
You can manually install JDK 1.8 on all managed hosts. If you are upgrading to any version of Cloudera Manager 5.x, you must use this procedure. Continue with the steps in the next section.
- Manually Migrating to OpenJDK
Manually Installing Oracle JDK 1.8
You can manually install Oracle JDK 1.8 on all managed hosts. If you are upgrading to any version of Cloudera Manager 5.x, you must use the following procedure:
- Download the
.tar.gz
file for one of the 64-bit versions of Oracle JDK 1.8 from Java SE 8 Downloads. (This link is correct at the time of writing, but can change.) - Perform the following steps on all hosts that you are upgrading:
- Log in to the host as
root
usingssh
. - Copy the downloaded
.tar.gz
file to the host. - Extract the JDK to the folder
/usr/java/jdk-version
. For example:tar xvfz /path/to/jdk-8u<update_version>-linux-x64.tar.gz -C /usr/java/
- Log in to the host as
- If you have configured TLS for Cloudera Manager (see Encrypting Data in Transit), copy the
jssecacerts
file from the previous JDK installation to the new JDK installation. This step is not required when using JDK 1.8.0_162 or greater. JDK 1.8.0_162 enables unlimited strength encryption by default.For example:
(Substitute previous_java_home and new_java_home with the paths to the JDK installations.)cp previous_java_home/jre/lib/security/jssecacerts new_java_home/jre/lib/security
- Configure the location of the JDK on cluster hosts.
- Open the Cloudera Manager Admin Console.
- In the main navigation bar, click the Hosts tab. If you are configuring the JDK location on a specific host only, click the link for that host.
- Click the Configuration tab.
- Select .
- Set the Java Home Directory property to the custom location.
- Click Save Changes.
- On the Cloudera Manager Server host only (not required for other hosts):
- Open the file
/etc/default/cloudera-scm-server
in a text editor. - Edit the line that begins with
export JAVA_HOME
(if this line does not exist, add it) and change the path to the path of the new JDK (you can find the path under/usr/java
).For example: (RHEL and SLES)export JAVA_HOME="/usr/java/jdk1.8.0_141-cloudera"
For example: (Ubuntu)export JAVA_HOME="/usr/lib/jvm/java-8-oracle-cloudera"
- Save the file.
- Restart the Cloudera Manager
Server.
sudo systemctl restart cloudera-scm-server
- Open the file
- Restart the Cloudera Management
Service.
- Log in to the Cloudera Manager Admin Console.
- Select .
- Select .
- Restart all clusters:
- On the tab, click the Options menu to the right of the cluster name and select Restart.
- Click Restart that appears in the next screen to confirm. If you have
enabled high availability for HDFS, you can choose
Rolling Restart
instead to minimize cluster downtime. The Command Details window shows the
progress of stopping services.
When All services successfully started appears, the task is complete and you can close the Command Details window.
- Delete the files from your previous Java installation. If you do not delete these files, Cloudera Manager and other components may continue to use the old version of the JDK.
OpenJDK
Manually Installing OpenJDK
Before installing or upgrading Cloudera Manager and CDH/Cloudera Runtime, perform the steps in this section to install OpenJDK on all hosts in your cluster(s).
When you install Cloudera Enterprise, Cloudera Manager includes an option to install Oracle JDK. De-select this option.
- Log in to each host and run the following command:
- If you are using the SLES operating system, Cloudera Manager needs an additional
configuration so that the JDK can be located:
- Log in to the Cloudera Manager server host.
- Open the following file in a text editor:
/etc/default/cloudera-scm-server
- Add the following line:
For example:export JAVA_HOME=path to the Java installation directory
export JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0
- Save the file.
- Restart the Cloudera Manager
Server.
sudo systemctl restart cloudera-scm-server
Manually Migrating to OpenJDK
If you have Oracle JDK 1.7, Oracle JDK 1.8, or OpenJDK 8* installed on the hosts managed by Cloudera Manager, use the steps in this section to transition your deployment to use OpenJDK. The steps below require you to restart all clusters, which will cause downtime as the hosts restart. If your clusters have enabled high availability for HDFS, you can use a Rolling Restart to restart the clusters without downtime. Note that until the rolling restart completes, some of the hosts in your cluster will still be using the Oracle JDK. If you do not want a temporarily mixed environment, you can stop the cluster before performing the steps in this section to transition the JDK.
- You must upgrade to Cloudera Manager 6.3 or higher, before upgrading to OpenJDK 11*.
- The package names used when installing the OpenJDK 11* are different and are noted in the steps below.
- The path for the default truststore has changed from (OpenJDK 8*)
jre/lib/security/cacerts
to (OpenJDK 11*)lib/security/cacerts
- See the following blog post for general information about migrating to Java 11: All You Need to Know For Migrating To Java 11.
- You must upgrade to Cloudera Manager 7.11.3 or higher, before upgrading to OpenJDK 17*.
- The package names used when installing the OpenJDK 17* are different and are noted in the steps below.
- The path to default truststore for OpenJDK 17* is
lib/security/cacerts
. - See the following blog post for general information about migrating to Java 17: Migrate to Java 17.
- Find out the package name of your currently installed JDK by running the following
commands. The grep commands attempt to locate the installed JDK. If the JDK package is
not returned, try looking for the string
jdk
.- RHEL
- Oracle JDK
8
yum list installed |grep oracle
- Ubuntu
- Oracle JDK
8
apt list --installed | grep oracle
- SLES
- Oracle JDK
8
zypper search --installed-only |grep oracle
The Oracle JDK package name in the above example is:oracle-j2sdk1.7.x86_64 1.7.0+update67-1 java-1.8.0-openjdk-devel
oracle-j2sdk1.7.x86_64
. The OpenJDK package isjava-1.8.0-openjdk-devel
. - Log in to each host managed by Cloudera Manager (including the Cloudera Manager server host) and run the following command to install OpenJDK:
- (This step is required for Oracle JDK 8 or OpenJDK 8* only) On the Cloudera
Manager Server host only (not required for other hosts):
- Open the file
/etc/default/cloudera-scm-server
in a text editor. - Edit the line that begins with
export JAVA_HOME
(if this line does not exist, add it) and change the path to the path of the new JDK (the JDK is usually installed in/usr/lib/jvm
)(or/usr/lib64/jvm
on SLES 12), but the path may differ depending on how the JDK was installed).For example:
- RHEL 7, 8
-
export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk"
- Ubuntu
-
export JAVA_HOME="/usr/lib/jvm/openjdk-8-jdk"
- SLES
-
export JAVA_HOME="/usr/lib64/jvm/java-1.8.0-openjdk"
- Save the file.
- Restart the Cloudera Manager
Server.
sudo systemctl restart cloudera-scm-server
- Open the file
- Tune the JDK (OpenJDK 11* or OpenJDK 17*).
OpenJDK 11* or OpenJDK 17* uses new defaults for garbage collection and other Java options specified when launching Java processes. Due to these changes you may need to tune the garbage collection by adjusting the Java options used to run cluster services, which are configured separately for each service using the service's configuration parameters. To locate the correct parameter, log in to the Cloudera Manager Admin Console, go to the cluster and service you want to configure and search for "Java Configuration Options".
When using OpenJDK 11* or OpenJDK 17*, Cloudera Manager and most services use G1GC as the default method of garbage collection. Java 8 used "ConcurrentMarkSweep" (CMS) for garbage collection. When using G1GC, the pauses for garbage collection are shorter, so components will usually be more responsive, but they are more sensitive to JVMs with overcommitted memory usage. See Tuning JVM Garbage Collection. - Restart the Cloudera Management
Service.
- Log in to the Cloudera Manager Admin Console.
- Select .
- Select .
- Restart all clusters:
- On the Restart or Rolling Restart. Selecting Rolling Restart minimizes cluster downtime and is available only If you have enabled Auto TLS. tab, click to the right of the cluster name and select either
- Click Restart or Rolling Restart that appears in
the next screen to confirm. The Command Details window shows the progress
of stopping services.
When All services successfully started appears, the task is complete and you can close the Command Details window.
- Remove the JDK:
- Perform the following steps on all hosts managed by Cloudera Manager:
- Run the following command to remove the JDK, using the package names from
Step 1: (If you do
not delete these files, Cloudera Manager and other components may continue to use the
old version of the JDK.)
- RHEL
-
yum remove <JDK package name>
- Ubuntu
-
apt-get remove <JDK package name>
- SLES
-
zypper rm <JDK package name>
- Confirm that the package has been removed:
- RHEL
-
yum list installed |grep -i java
- Ubuntu
-
apt list --installed | grep -i java
- SLES
-
zypper search --installed-only |grep -i java
- Run the following command to remove the JDK, using the package names from
Step 1: (If you do
not delete these files, Cloudera Manager and other components may continue to use the
old version of the JDK.)
- Perform the following steps on all hosts managed by Cloudera Manager: