Reply
Cloudera Employee
Posts: 509
Registered: ‎07-30-2013

Re: How to install Java 1.7 with Cloudera Manager?

[ Edited ]

Oops, I missed your note at the end saying you did restart the cluster.

That error usually means there are files compiled with different JDKs. I would check the stderr log of any hadoop process, like a data node. Navigate to a DataNode's status page, then click on Processes, then look at the stderr log. Near the top it goes through logic to detect java home. Let us know what it says, I assume it's picking up the wrong thing.

New Contributor
Posts: 14
Registered: ‎03-31-2014

Re: How to install Java 1.7 with Cloudera Manager?

[ Edited ]

 

Hi Darren,

 

Looks like it is picking up JDK1.6

 

+ locate_cdh_java_home
+ '[' -z '' ']'
+ '[' -z /opt/cloudera/parcels/CDH-4.6.0-1.cdh4.6.0.p0.26/lib/bigtop-utils ']'
+ local BIGTOP_DETECT_JAVAHOME=
+ for candidate in '"${JSVC_HOME}"' '"${JSVC_HOME}/.."' '"/usr/lib/bigtop-utils"' '"/usr/libexec"'
+ '[' -e /opt/cloudera/parcels/CDH-4.6.0-1.cdh4.6.0.p0.26/lib/bigtop-utils/bigtop-detect-javahome ']'
+ BIGTOP_DETECT_JAVAHOME=/opt/cloudera/parcels/CDH-4.6.0-1.cdh4.6.0.p0.26/lib/bigtop-utils/bigtop-detect-javahome
+ break
+ '[' -z /opt/cloudera/parcels/CDH-4.6.0-1.cdh4.6.0.p0.26/lib/bigtop-utils/bigtop-detect-javahome ']'
+ . /opt/cloudera/parcels/CDH-4.6.0-1.cdh4.6.0.p0.26/lib/bigtop-utils/bigtop-detect-javahome
++ '[' -r /etc/default/bigtop-utils ']'
++ JAVA6_HOME_CANDIDATES='\
    /usr/lib/j2sdk1.6-sun \
    /usr/lib/jvm/java-6-sun \
    /usr/lib/jvm/java-1.6.0-sun-1.6.0.* \
    /usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/ \
    /usr/lib/jvm/j2sdk1.6-oracle \
    /usr/lib/jvm/j2sdk1.6-oracle/jre \
    /usr/java/jdk1.6* \
    /usr/java/jre1.6*'
++ OPENJAVA6_HOME_CANDIDATES='\
    /usr/lib/jvm/java-1.6.0-openjdk \
    /usr/lib/jvm/java-1.6.0-openjdk-* \
    /usr/lib/jvm/jre-1.6.0-openjdk*'
++ JAVA7_HOME_CANDIDATES='\
    /usr/java/jdk1.7* \
    /usr/java/jre1.7* \
    /usr/lib/jvm/j2sdk1.7-oracle \
    /usr/lib/jvm/j2sdk1.7-oracle/jre \
    /usr/lib/jvm/java-7-oracle*'
++ OPENJAVA7_HOME_CANDIDATES='\
    /usr/lib/jvm/java-1.7.0-openjdk* \
    /usr/lib/jvm/java-7-openjdk*'
++ MISCJAVA_HOME_CANDIDATES='\
    /Library/Java/Home \
    /usr/java/default \
    /usr/lib/jvm/default-java \
    /usr/lib/jvm/java-openjdk \
    /usr/lib/jvm/jre-openjdk'
++ case $BIGTOP_JAVA_MAJOR in
++ JAVA_HOME_CANDIDATES='\
    /usr/lib/j2sdk1.6-sun \
    /usr/lib/jvm/java-6-sun \
    /usr/lib/jvm/java-1.6.0-sun-1.6.0.* \
    /usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/ \
    /usr/lib/jvm/j2sdk1.6-oracle \
    /usr/lib/jvm/j2sdk1.6-oracle/jre \
    /usr/java/jdk1.6* \
    /usr/java/jre1.6*                                \
    /usr/java/jdk1.7* \
    /usr/java/jre1.7* \
    /usr/lib/jvm/j2sdk1.7-oracle \
    /usr/lib/jvm/j2sdk1.7-oracle/jre \
    /usr/lib/jvm/java-7-oracle*                                \
    /Library/Java/Home \
    /usr/java/default \
    /usr/lib/jvm/default-java \
    /usr/lib/jvm/java-openjdk \
    /usr/lib/jvm/jre-openjdk                             \
    /usr/lib/jvm/java-1.7.0-openjdk* \
    /usr/lib/jvm/java-7-openjdk*                            \
    /usr/lib/jvm/java-1.6.0-openjdk \
    /usr/lib/jvm/java-1.6.0-openjdk-* \
    /usr/lib/jvm/jre-1.6.0-openjdk*'
++ '[' -z '' ']'
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd '\'
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd /usr/lib/j2sdk1.6-sun
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd '\'
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd /usr/lib/jvm/java-6-sun
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd '\'
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*'
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd '\'
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/'
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd '\'
++ for candidate_regex in '$JAVA_HOME_CANDIDATES'
+++ ls -rd /usr/lib/jvm/j2sdk1.6-oracle
++ for candidate in '`ls -rd $candidate_regex 2>/dev/null`'
++ '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
++ export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
++ JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
++ break 2
+ verify_java_home
+ '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
+ echo JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
+ . /usr/lib/cmf/service/common/cdh-default-hadoop

 

I notice that the other JDK (1.7), is not even listed in the options it is searching for. 

 

Also, when I try to list the installed JVMs, 1.7 is not listed, but it is there:

 

ubuntu@ip-10-36-46-92:~$ update-java-alternatives -l
j2sdk1.6-oracle 315 /usr/lib/jvm/j2sdk1.6-oracle
ubuntu@ip-10-36-46-92:~$ ls -ll /usr/lib/jvm/

total 8
drwxr-xr-x 11 root root 4096 Apr 16 18:30 j2sdk1.6-oracle
drwxr-xr-x 8 root root 4096 Apr 16 18:23 java-7-oracle-cloudera

 

Thanks,

Bhushan

Cloudera Employee
Posts: 509
Registered: ‎07-30-2013

Re: How to install Java 1.7 with Cloudera Manager?

When you look at the Processes tab, it should list all environment variables. If you've configured this correctly, then JAVA_HOME should be set there. Is it?
New Contributor
Posts: 14
Registered: ‎03-31-2014

Re: How to install Java 1.7 with Cloudera Manager?

Hi Darren

 

Yes, under the Processes tab, of the DataNode, the stdout shows JAVA_HOME to be set correctly:

 

Fri Apr 18 19:01:06 UTC 2014
JAVA_HOME=/usr/lib/jvm/java-7-oracle-cloudera
using /usr/lib/jvm/java-7-oracle-cloudera as JAVA_HOME
using 5 as CDH_VERSION
using /run/cloudera-scm-agent/process/7-hdfs-DATANODE as CONF_DIR
using  as SECURE_USER
using  as SECURE_GROUP
unlimited

 

Looks like Hadoop itself is picking up the right Java version. But not the submitted job itself. Anything you can suggest to fix this?

 

Thanks,

Bhushan

Cloudera Employee
Posts: 509
Registered: ‎07-30-2013

Re: How to install Java 1.7 with Cloudera Manager?

What do the job logs say? Can you find anything about the job's environment?

Assuming you are using YARN to run jobs, you can try editing "yarn.nodemanager.env-whitelist" to remove JAVA_HOME. That way it will always pick up whatever the node manager is using. Worth double-checking the node manager's stderr to make sure it's using the right java home.

If that doesn't work, you can also try adding JAVA_HOME to "yarn.nodemanager.admin-env", but I don't think that should be necessary.

You may also want to add JAVA_HOME to your _client_ environment safety valve for MR or YARN and re-deploy your cluster's client configuration. This will make sure your clients have JAVA_HOME set to the right thing when submitting jobs.
New Contributor
Posts: 14
Registered: ‎03-31-2014

Re: How to install Java 1.7 with Cloudera Manager?

I am not using YARN :(

 

Also, where is the "safety valve for MR", _client_ environment ?

Highlighted
Cloudera Employee
Posts: 2
Registered: ‎07-08-2013

Re: How to install Java 1.7 with Cloudera Manager?

To get to the client environment safety value, do this:

 

  1. Go to the MapReduce service status page.
  2. Select Configuration > View and Edit.
  3. Expand Gateway (Default) > Advanced.
  4. Click MapReduce Client Environment Safety Valve for hadoop-env.sh.

 

Announcements