All Articles

Configure and Update a Local JRE

background

For optimal performance with a Boomi Integration Runtime, it is important to use a local copy of a Java Runtime Environment (JRE) or Java Development Kit (JDK). By default, Boomi will install a copy of JRE 8 or JDK 11 to the atom install directory. For Atoms, this is not an issue because the atom directory is usually on a drive local to the server. Yet, for a clustered runtime - i.e. Molecule or Atom Cloud - the atom directory is located on a file share. Performance improvements can be made by moving a copy of the JRE/JDK from the file share to a local disk.

In general, there are two steps involved in configuring a local copy of Java: 1) Create a local JRE/JDK and 2) define the JRE/JDK that the Integration Runtime should use. Once those steps are complete, the article will review the steps involved when updating the local Java version.

Configure Local Java

By default, Boomi will install a JDK (Java 11) within <atom-dir>/jre. Copy this directory from the file share to a local directory on each node. Ensure that the service account has access to the directory and owns the contents of the directory.

# Move directory syntax for Linux
mv <atom-dir>/jre <local-dir>

# Bash Example
mv /boomi/share/molecule_name/jre /boomi/local

Configure pref_jre.cfg

The next step to configuring the version of Java is to update the pref_jre.cfg file which determines the Java location being used. Navigate and edit <atom-dir>/.install4j/pref_jre.cfg. The file will have a single line that by default will point to <atom-dir>/jre. If pref_jre.cfg is not found within .install4j, then create a copy of inst_jre.cfg. Replace the contents of the file with the location of the local JRE/JDK. Once replaced, restart a single node by executing <atom-dir>/bin/atom restart. If there are any issues with the update, only one node will be affected and any errors resolved.

pref jre

Figure 1. Example pref_jre.cfg file contents for a Linux-based Molecule install.

Example directory syntax

# Linux Example
/mnt/boomi/cloud/jre

# Windows Example
C:\Program Files\Java\jre8
C:\Program Files\jdk\jre

Two additional Properties need to be set when updating the version of Java for an Atom Cloud or Molecule with Forked Executions. Java Class Path Prepend and Java Library Path should both be set within Advanced Properties. The value should be set to the location of the local JRE or JDK, which will be the same value as in the pref_jre.cfg.

Update Local Java Copy

The Java updater within the Boomi UI will only update the Java version on the file share. Therefore, the local Java version needs to be manually updated on each node. When updating the version of Java, the local node will need to be stopped, the local Java directory will need to be updated with the desired Java version, and the node can then be started back up. The most recent version supported by Boomi can be downloaded using https://platform.boomi.com/atom/molecule_upgrade64.sh, for Molecule, or https://platform.boomi.com/atom/cloud_upgrade64.sh, for Atom Clouds. The sh file can be executed and will install the currently supported version of Java in <atom-dir>/jre. The directory can then be copied from the file share to the local JRE/JDK directory. If you want to download a specific version of Java, it can be downloaded from Amazon’s Github Release Page. Downloading a specific version of Java from Amazon can be a better solution if updating Java in lower environments and promoting the same version to production.

Below are two Linux example scripts for updating the local version of Java with either the Boomi Java Update script or with a specific version of Amazon Corretto. Update them as needed to suit your business needs.

#!/bin/bash

# Example using Boomi Update Java Script with Linux

atom_dir="set_the_atom_dir"
dir_containing_local_jre_dir="set_the_dir_that_contains_the_local_jre"

# Move to tmp and download updater. This example is for a molecule. Update as needed.
cd /tmp
wget https://platform.boomi.com/atom/molecule_upgrade64.sh
chmod +x molecule_upgrade64.sh
./molecule_upgrade64.sh -q -console VprefJreLocation=current -dir $atom_dir

# Stop runtime
$atom_dir/bin/atom stop

# The updater will create a new jre directory in the atom directory.
# Move the current JDK to a backup folder 
# and move the new JDK within the atom directory to the local jre directory.
echo "Removing old jre_backup..."
rm -rf $dir_containing_local_jre_dir/jre_backup
echo "Moving current jre to jre_backup..."
mv $dir_containing_local_jre_dir/jre $dir_containing_local_jre_dir/jre_backup

# Move to update Java version on the fil share into the local Java directory
echo "Moving new jre..."
mkdir -p $dir_containing_local_jre_dir
mv $atom_dir/jre $dir_containing_local_jre_dir

# Start the node back up
$atom_dir/bin/atom start
#!/bin/bash

# Example using Amazon Corretto Link with Linux 

dir_containing_local_jre_dir="set_the_dir_that_contains_the_local_jre"

# Move to tmp and download Amazon Corrector JDK. Update as needed. Select the desired version.
cd /tmp
wget https://corretto.aws/downloads/resources/11.0.21.9.1/amazon-corretto-11.0.21.9.1-linux-x64.tar.gz
tar -xvf amazon-corretto-11.0.21.9.1-linux-x64.tar.gz

# Stop runtime
$atom_dir/bin/atom stop

# Move the current JDK to a backup folder 
# and move the new JDK to the local jre directory.
echo "Removing old jre_backup..."
rm -rf $dir_containing_local_jre_dir/jre_backup
echo "Moving current jre to jre_backup..."
mv $dir_containing_local_jre_dir/jre $dir_containing_local_jre_dir/jre_backup

# Move to contents of the extracted folder into the local Java directory
echo "Moving new jre..."
mkdir -p $dir_containing_local_jre_dir
mv /tmp/amazon-corretto-11.0.21.9.1-linux-x64/* $dir_containing_local_jre_dir

# Start the node back up
$atom_dir/bin/atom start

References

The article was originally posted at Boomi Community.

Published Dec 18, 2023

Developing a better world.© All rights reserved.