Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce, mail # user - Re: ClassNotFound Error when use hdfs namenode -format in 2.0.4


Copy link to this message
-
Re: ClassNotFound Error when use hdfs namenode -format in 2.0.4
Harsh J 2013-06-06, 02:22
Do not use HADOOP_HOME anymore. Try removing the below line (and any
other references in your env to HADOOP_HOME):

export HADOOP_HOME="/hadoop-2.0.4-alpha"

On Thu, Jun 6, 2013 at 1:18 AM, Boyu Zhang <[EMAIL PROTECTED]> wrote:
> 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

--
Harsh J