hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boyu Zhang <boyuzhan...@gmail.com>
Subject ClassNotFound Error when use hdfs namenode -format in 2.0.4
Date Wed, 05 Jun 2013 19:48:56 GMT
Dear All,

I just moved from version 0.20.2 to 2.0.4, there are a lot of changes
Hadoop has been going through!

I followed the instructions here:
http://hadoop.apache.org/docs/r2.0.4-alpha/hadoop-project-dist/hadoop-common/SingleCluster.html

I changed the hadoop-2.0.4-alpha/etc/hadoop/hadoop-env.sh:

export JAVA_HOME="/usr"
export HADOOP_HOME="/hadoop-2.0.4-alpha"
export HADOOP_COMMON_HOME="/hadoop-2.0.4-alpha/share/hadoop/common"
export HADOOP_HDFS_HOME="/hadoop-2.0.4-alpha/share/hadoop/hdfs"
export HADOOP_MAPRED_HOME="/hadoop-2.0.4-alpha/share/hadoop/mapreduce"
export HADOOP_YARN_HOME="/hadoop-2.0.4-alpha/share/hadoop/mapreduce"

But when I tried to format the namenode using: bin/hdfs namenode -format, I
got the following error:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/hadoop/hdfs/server/namenode/NameNode
Caused by: java.lang.ClassNotFoundException:
org.apache.hadoop.hdfs.server.namenode.NameNode
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Could not find the main class:
org.apache.hadoop.hdfs.server.namenode.NameNode. Program will exit.

I tried to add the jar files in the /share/hadoop/common, hdfs, mapreduce
into the CLASSPATH, but still I get the same error.

Could anyone give any directions on what may go wrong?

Thanks,
Boyu

Mime
View raw message