Wednesday, November 4, 2015

Error: Could not find or load main classorg.apache.hadoop.hdfs.server.namenode.NameNode

Error: Could not find or load main class org.apache.hadoop.hdfs.server.namenode.NameNode

This error "Error: Could not find or load main class org.apache.hadoop.hdfs.server.namenode.NameNode" can be seen When you try to execute the below command.

$ bin/hdfs namenode -format

The most common reason for this is the HADOOP_PREFIX environment variable is not set or to the correct path atleast.To set the path to the current session execute the following or set it in the profile permanently:

$ export HADOOP_PREFIX=/path_to_hadoop_location

For example,

$ export HADOOP_PREFIX= /u01/bigdata/hadoop

Once the value is set and running the command again the following start up messages should be seen.

-bash-4.2$ bin/hdfs namenode -format
15/10/20 14:13:07 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = localhost/10.xx.xx.xx
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 2.6.1
STARTUP_MSG:   classpath = /u01/bigdata/hadoop/etc/hadoop:/u01/bigdata/hadoop/share/hadoop/common/
..................................................................................

4 comments:

  1. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    base-sas training in chennai

    ReplyDelete
  2. • Great information, I like this kind of blog information really very nice and more I can easily new skills are develop after reading that post.
    unix training in chennai

    ReplyDelete
  3. • Thanks for all your information, Website is very nice and informative content.
    java training in chennai

    ReplyDelete