This is the documentation for Cloudera Manager 4.8.5.
Documentation for other versions is available at Cloudera Documentation.

Using Custom Java Home Locations

Java, which Cloudera services require, may be installed at a custom location. In a such a case, Cloudera services may be unable to find this resource. If the JDK cannot be found, services such as MapReduce or HDFS may not start. If you installed the JDK to a custom location, you may need to modify the system configuration to ensure the JDK can be found.

For more information on installing the JDK, see "Java Development Kit Installation for CDH3" in the CDH3 Installation Guide or "Java Development Kit Installation for CDH4" in the CDH4 Installation Guide.

Cloudera provides two ways to ensure Cloudera services can find the JDK installation: modifying the Cloudera Agent Java home and modifying the service's Java home.

Modifying the Cloudera Agent Java Home

In many cases, modifying the CMF_AGENT_JAVA_HOME environment variable is an effective solution for updating the configuration to accommodate a custom JAVA_HOME. Modifying the CMF_AGENT_JAVA_HOME environment variable enables all services on the host to find the JDK.

  1. Open /etc/default/cloudera-scm-agent.
  2. Set the CMF_AGENT_JAVA_HOME environment variable to the Java home in your environment. For example, you might modify the file to include the following line:
    export CMF_AGENT_JAVA_HOME=/usr/custom_java
  3. Save and close the cloudera-scm-agent file.
  4. Restart the Cloudera Manager Agent using the following command:
    sudo service cloudera-scm-agent restart

Modifying Service Java Home

You can modify service settings to use a custom JAVA_HOME. This is done as an alternative to modifying the CMF_AGENT_JAVA_HOME environment variable. Modifying service settings to use a custom JAVA_HOME applies to all hosts in the cluster, but you must repeat this process of updating JAVA_HOME for all services.

  1. Open the Cloudera Manager Admin Console. In the Home page, click the service that fails to start because the JDK location is misconfigured.
  2. Select Configuration > View and Edit.
  3. Add the custom Java home environment property, for example, JAVA_HOME=/opt/java/jdk6, to the service's environment safety valve.
  4. Click Save Changes.
  5. If your deployment includes Cloudera Management Services, add the custom JAVA_HOME value to /usr/share/cmf/bin/cmf-server.
  6. Restart the service.

To see how Cloudera Manager chooses a default JDK, review the contents of /usr/lib64/cmf/service/common/cloudera-config.sh.