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 Cloudera Director API, but it is not currently configurable in the Cloudera Director web UI.

Once a particular JDK installation strategy has been used to bootstrap a new Cloudera Manager deployment and JDK cluster, Cloudera 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, Cloudera Director installs the JDK on the Cloudera Manager node, and then Cloudera Manager handles JDK installation for all instances in the cluster. If needed, Cloudera Director also installs unlimited strength JCE policy files on the Cloudera Manager instance, and directs Cloudera Manager to install them on all cluster instances.

The JDK version installed depends on the cmJavaPackages and defaultCmJavaPackage properties in the application.properties file, as described below:
  • When Cloudera Director can determine the Cloudera Manager version, the configuration property lp.bootstrap.packages.cmJavaPackages determines the Java package used. 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 use for it. In this example, Java 8 is used for Cloudera Manager 5.13.x, and Java 7 for any other version:
    5\.13\..*=oracle-j2sdk1.8,5\..*=oracle-j2sdk1.7
  • When Cloudera Director cannot determine the Cloudera Manager version, the configuration property lp.bootstrap.packages.defaultCmJavaPackage determines the Java package used.

To guarantee that JDK 8 is used, change cmJavaPackages to .*=oracle-j2sdk1.8 and change defaultCmJavaPackage to oracle-j2sdk1.8.

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.7 for Cloudera Manager 5, which is the default behavior for Cloudera Director, then you don't have to do anything further, because Cloudera Director always configures the Cloudera Manager repository, and the Cloudera Manager repository has oracle-j2sdk1.7 (and not oracle-j2sdk1.8).
  • If you select oracle-j2sdk1.8 for Cloudera Manager 5 or 6, then you need to use a bootstrap script or AMI that ensures that the right yum repository is configured. The repository for Cloudera Director 2.x has oracle-j2sdk1.7 and oracle-j2sdk1.8.

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 Cloudera Director web UI use the default AUTO setting.

DIRECTOR_MANAGED JDK Installation Strategy

With the DIRECTOR_MANAGED setting, Cloudera 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.

With this installation strategy, you can choose the Java version to be installed for Cloudera Manager and for CDH cluster instances.
  • When Cloudera Director can determine the Cloudera Manager version, the configuration property lp.bootstrap.packages.cmJavaPackages determines the Java package used. 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 use for it. In this example, Java 8 is used for Cloudera Manager 5.13.x, and Java 7 for any other version:
    5\.13\..*=oracle-j2sdk1.8,5\..*=oracle-j2sdk1.7
  • When Cloudera Director cannot determine the Cloudera Manager version, the configuration property lp.bootstrap.packages.defaultCmJavaPackage determines the Java package used.

To guarantee that JDK 8 is used, change cmJavaPackages to .*=oracle-j2sdk1.8 and change defaultCmJavaPackage to oracle-j2sdk1.8.

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.7 for Cloudera Manager 5, which is the default behavior for Cloudera Director, then you don't have to do anything further, because Cloudera Director always configures the Cloudera Manager repository, and the Cloudera Manager repository has oracle-j2sdk1.7 (and not oracle-j2sdk1.8).
  • If you select oracle-j2sdk1.8 for Cloudera Manager 5 or 6, then you need to use a bootstrap script or AMI that ensures that the right yum repository is configured. The repository for Cloudera Director 2.x has oracle-j2sdk1.7 and oracle-j2sdk1.8.

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 Cloudera Director nor Cloudera Manager install a JDK; you must manage all JDK installation yourself, for example, by using bootstrap scripts or pre-baked images. When running a bootstrap script, Cloudera Director can install any Java package that instances can find with yum.

Here is how this setting looks in a configuration file:

...
cloudera-manager {

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

Bootstrap Script for Java 8 Installation

A bootstrap script for Java 8 installation java8-bootstrap-script.sh is located on the Cloudera public GitHub site. Also on the site is a copy of the instructions for using a script to install a Java 8 cluster, Deploying a Java 8 cluster.
The bootstrap script java8-bootstrap-script.sh is an example of a script that can be used for the instance templates in a cluster. This will install Java 8, which will be used to run Cloudera Manager and all of the cluster services. The following example shows how this might look in a configuration file:
instances {
    m3x {
        type: m3.xlarge
        image: ami-6283a827
        bootstrapScriptsPaths: ["/script-path/java8-bootstrap-script.sh"]
    }
}
Alternatively, you can copy the contents of the bootstrap script itself and use the bootstrapScripts property instead.