Deploying Java on Cluster Instances

When you set up Cloudera Manager and CDH clusters in the cloud, a version of the Java JDK must be installed on each instance. Choose one of the three JDK installation strategies described below for your Cloudera Manager instance and the CDH clusters it manages. The JDK installation strategy can be set using a configuration file or using the Altus Director API, but it is not currently configurable in the Altus Director web UI.

Once a particular JDK installation strategy has been used to bootstrap a new Cloudera Manager deployment and JDK cluster, Altus Director continues to follow that JDK installation strategy for all additional clusters added to that Cloudera Manager deployment.

AUTO JDK Installation Strategy

With the AUTO setting, Altus Director installs the JDK on the Cloudera Manager node, and then Cloudera Manager handles JDK installation for all instances in the cluster. If needed, Altus Director also installs unlimited strength JCE policy files on the Cloudera Manager instance, and directs Cloudera Manager to install them on all cluster instances.

When you use the AUTO JDK installation strategy, you can specify the Java version that Director installs on the Cloudera Manager node. You cannot specify the Java version that Cloudera Manager installs on the CDH clusters.

Altus Director verifies the Cloudera Manager version and determines the JDK version to install based on the following Java package properties in the application.properties file:
  • lp.bootstrap.packages.cmJavaPackages. If Altus Director can determine the Cloudera Manager version, Altus Director installs the Java package specified in the cmJavaPackages property.
    The property is a list of key-value pairs, where each key is a regular expression for a Cloudera Manager version, and each value is the corresponding Java package to install. For example, with the following property settings, Altus Director installs Oracle JDK 8 on Cloudera Manager 6.x and Oracle JDK 7 on Cloudera Manager 5.x:
    lp.bootstrap.packages.cmJavaPackages[0]: "6\\..*=oracle-j2sdk1.8"
    lp.bootstrap.packages.cmJavaPackages[1]: "5\\..*=oracle-j2sdk1.7"
  • lp.bootstrap.packages.defaultCmJavaPackage. If Altus Director cannot determine the Cloudera Manager version, Altus Director installs the Java package specified in the defaultCmJavaPackage property.
    For example, the following property settings installs Oracle JDK 8 on all Cloudera Manager nodes:
    lp.bootstrap.packages.defaultCmJavaPackage: oracle-j2sdk1.8

By default, Altus Director installs Oracle JDK 8 for Cloudera Manager 6.x and Oracle JDK 7 for Cloudera Manager 5.x on all nodes, as indicated by the default values specified in the lp.bootstrap.packages.cmJavaPackages and lp.bootstrap.packages.defaultCmJavaPackage properties in the application properties file.

You can set the lp.bootstrap.packages.cmJavaPackages and lp.bootstrap.packages.defaultCmJavaPackage properties with the JDK version that you want to install on the Cloudera Manager node. For example, if you want to install Oracle JDK 8 on Cloudera Manager, set cmJavaPackages to .*=oracle-j2sdk1.8 and defaultCmJavaPackage to oracle-j2sdk1.8.

If you want to install OpenJDK, set the properties to the OpenJDK package for the version you want to install. For example, with the following property settings, Altus Director installs OpenJDK 8 on Cloudera Manager 6.x and OpenJDK 7 on Cloudera Manager 5.x:
lp.bootstrap.packages.cmJavaPackages[0]: "6\\..*=java-1.8.0-openjdk"
lp.bootstrap.packages.cmJavaPackages[1]: "5\\..*=java-1.7.0-openjdk"
You must ensure that yum is configured with a repository that contains the Java package you have chosen, as described below:
  • If you select oracle-j2sdk1.8 for Cloudera Manager 6.x, which is the default behavior for Altus Director, then you don't have to do anything further, because Altus Director always configures the Cloudera Manager repository, and the Cloudera Manager repository has oracle-j2sdk1.8.
  • If you select oracle-j2sdk1.8 for Cloudera Manager 5.x, then you need to use a bootstrap script or AMI that ensures that the right yum repository is configured. The repository for Altus Director 2.x has oracle-j2sdk1.7 and oracle-j2sdk1.8.
  • To install OpenJDK instead of Oracle JDK, ensure that the yum repository contains the OpenJDK Java version that you require.

AUTO is the default JDK installation strategy, so it is not necessary to specify it in a configuration file or using the API. All installations done with the Altus Director web UI use the default AUTO setting.

DIRECTOR_MANAGED JDK Installation Strategy

With the DIRECTOR_MANAGED setting, Altus Director installs the JDK for all Cloudera Manager and cluster instances from a yum repository. The JDK installation includes unlimited strength JCE policy files, should you require them.

When you use the DIRECTOR_MANAGED installation strategy, you can specify the Java version that Director installs on the Cloudera Manager node and on the CDH clusters.

Altus Director verifies the Cloudera Manager version and determines the JDK version to install based on the following Java package properties in the application.properties file:
  • lp.bootstrap.packages.cmJavaPackages. If Altus Director can determine the Cloudera Manager version, Altus Director installs the Java package specified in the cmJavaPackages property.
    The property is a list of key-value pairs, where each key is a regular expression for a Cloudera Manager version, and each value is the corresponding Java package to install. For example, with the following property settings, Altus Director installs Oracle JDK 8 on Cloudera Manager 6.x and CDH clusters and Oracle JDK 7 on Cloudera Manager 5.x and CDH clusters:
    lp.bootstrap.packages.cmJavaPackages[0]: "6\\..*=oracle-j2sdk1.8"
    lp.bootstrap.packages.cmJavaPackages[1]: "5\\..*=oracle-j2sdk1.7"
  • lp.bootstrap.packages.defaultCmJavaPackage. If Altus Director cannot determine the Cloudera Manager version, Altus Director installs the Java package specified in the defaultCmJavaPackage property.
    For example, the following property settings installs Oracle JDK 8 on all Cloudera Manager nodes and CDH clusters:
    lp.bootstrap.packages.defaultCmJavaPackage: oracle-j2sdk1.8

By default, Altus Director installs Oracle JDK 8 for Cloudera Manager 6.x and Oracle JDK 7 for Cloudera Manager 5.x on all nodes, as indicated by the default values specified in the lp.bootstrap.packages.cmJavaPackages and lp.bootstrap.packages.defaultCmJavaPackage properties in the application properties file.

You can set the lp.bootstrap.packages.cmJavaPackages and lp.bootstrap.packages.defaultCmJavaPackage properties with the JDK version that you want to install on the Cloudera Manager node and the CDH clusters. For example, if you want to install Oracle JDK 8 on Cloudera Manager and clusters, set cmJavaPackages to .*=oracle-j2sdk1.8 and defaultCmJavaPackage to oracle-j2sdk1.8.

If you want to install OpenJDK, set the properties to the OpenJDK package for the version you want to install. For example, with the following property settings, Altus Director installs OpenJDK 8 on Cloudera Manager 6.x and CDH clusters. Altus Director installs OpenJDK 7 on Cloudera Manager 5.x and CDH clusters:
lp.bootstrap.packages.cmJavaPackages[0]: "6\\..*=java-1.8.0-openjdk"
lp.bootstrap.packages.cmJavaPackages[1]: "5\\..*=java-1.7.0-openjdk"
You must ensure that yum is configured with a repository that contains the Java package you have chosen, as described below:
  • If you select oracle-j2sdk1.8 for Cloudera Manager 6.x, then you don't have to do anything further, because Altus Director always configures the Cloudera Manager repository, and the Cloudera Manager 6 repository has oracle-j2sdk1.8.
  • If you select oracle-j2sdk1.8 for Cloudera Manager 5.x, then you need to use a bootstrap script or AMI that ensures that the right yum repository is configured. The repository for Altus Director 2.x has oracle-j2sdk1.7 and oracle-j2sdk1.8.
  • To install OpenJDK instead of Oracle JDK, ensure that the yum repository contains the OpenJDK Java version that you require.

Here is how the DIRECTOR_MANAGED setting looks in a configuration file:

...
cloudera-manager {

    instance: ${instances.m3x} {
        tags {
            application: "Cloudera Manager 5"
        }
    }
    javaInstallationStrategy: DIRECTOR_MANAGED
    ...
}

NONE JDK Installation Strategy

With the NONE installation strategy, neither Altus Director nor Cloudera Manager installs a JDK. You must manage all JDK installation yourself, for example, by using bootstrap scripts or pre-baked images.

Here is how this setting looks in a configuration file:

...
cloudera-manager {

    instance: ${instances.m3x} {
        tags {
            application: "Cloudera Manager 5"
        }
    }
    javaInstallationStrategy: NONE
    ...
}