简体   繁体   中英

can't find or load class: org.apache.hadoop.hdfs.server.namenode.NameNode

I installed hadoop on my mac, I followed the hadoop installation step by step

when I execute the hdfs namenode -format

hadoop always return me the error can't find or load class org.apache.hadoop.hdfs.server.namenode.NameNode

here is my /etc/profile:

 export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/contents/home
 export JRE_HOME=$JAVA_HOME/jre
 export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
 export HADOOP_HOME=/usr/local/Cellar/hadoop/2.7.0
 export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME:$PATH

I have no idea where is incorrect, could anyone kindly help me have a check ?

1) Please check the core-site.xml in /etc/hadoop/conf/ and edit it properly as follows: core-site.xml:

  <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://localhost:9000</value> </property> </configuration> 

2) Please change the path to export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH and source the profile again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM