Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Unable to format NameNode - PseudoNode cluster

avatar
Expert Contributor

Hi,

I have just built a Pseudo Node cluster following below article:

 

http://www.cloudera.com/content/www/en-us/documentation/enterprise/latest/topics/cdh_qs_yarn_pseudo....

 

Initally I had missed to install Java however, after getting below error while formatting NameNode I installed Java 1.6:

JAVA_HOME is not set and could not be found.

Even after installing it (jdk-6u31-linux-amd64.rpm), I am still getting below error (a bit different but I guess related to Java). I feel I need to explicitly set the paths in .bashrc, hadoo-env.sh and /etc/profile files (not sure though). I am unsure how do I do it for the same (as I am pretty new to Linux and Hadoop).

 

[node1@primary ~]$ sudo -u hdfs hdfs namenode -format
[sudo] password for node1: 
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hdfs/server/namenode/NameNode : Unsupported major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.hadoop.hdfs.server.namenode.NameNode.  Program will exit.
[node1@primary ~]$ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)
[node1@primary ~]$ 


Would be great if someone could help.

 

Thanks

snm1523

1 ACCEPTED SOLUTION

avatar
Mentor
CDH5 is compiled with JDK7, and will not run with a lesser JDK version (such as 6, which is no longer supported). Please install JDK7 from http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5/RPMS/x86_64/oracle-j2sdk1.7-1.7.0+update67-1.x8... or use JDK8 from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Please also remove JDK6 to avoid confusion in selection of the right JVM to run with.

View solution in original post

2 REPLIES 2

avatar
Mentor
CDH5 is compiled with JDK7, and will not run with a lesser JDK version (such as 6, which is no longer supported). Please install JDK7 from http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5/RPMS/x86_64/oracle-j2sdk1.7-1.7.0+update67-1.x8... or use JDK8 from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Please also remove JDK6 to avoid confusion in selection of the right JVM to run with.

avatar
Expert Contributor

Thank you for the help, Harsh.

 

Have updated to version 1.8.0_65 which worked.

 

Thanks

Snm1523