Hadoop部署在RedHat Linux 5上常見錯誤及解決方案

來源:互聯網
上載者:User
關鍵字 dfs name 解決方案 redhat java
遇到的問題:


  1、在hadoop conf下執行命令: hadoop-daemon.sh start datanode,無法啟動hadoop datanode:


  [hadoop@master conf]$ hadoop-daemon.sh start datanode


  Warning: $HADOOP_HOME is deprecated.


  starting datanode, logging to /opt/modules/hadoop/hadoop-1.1.2/libexec/.. /logs/hadoop-hadoop-datanode-master.out


  [hadoop@master conf]$ jps


  4662 NameNode


  4819 Jps


  [hadoop@master conf]$ tail -300f /opt/modules/hadoop/hadoop-1.1.2/libexec/.. /logs/hadoop-hadoop-datanode-master.log


  報錯:


  Incompatible HTTP://www.aliyun.com/zixun/aggregation/11696.html">namespaceIDs in /data/hadoop/hdfs/data: namenode namespaceID = 573007068; datanode namespaceID = 1802250800


  解決方法:用網上介紹的第一種:刪除data目錄(即是在hdfs-site.xml檔中配置的dfs.data.dir目錄)然後重啟datanode。


  [hadoop@master conf]$ rm -rf /data/hadoop/hdfs/data


[hadoop@master conf]$ ll /data/hadoop/hdfs/


  total 8


  drwxrwxr-x 5 hadoop hadoop 4096 Jul 6 08:17 name


  drwxrwxr-x 2 hadoop hadoop 4096 Jul 2 06:59 namesecondary


  [hadoop@master conf]$ hadoop-daemon.sh start datanode


  2、啟動Jobtracker時報錯:


  2013-07-06 10:03:09,584 INFO org.apache.hadoop.mapred.JobTracker: problem cleaning system directory: hdfs://master :9000/data/hadoop/mapred/mrsystem


  org.apache.hadoop.ipc.RemoteException: java.io.FileNotFoundException: Parent path is not a directory: /data


  原因是:有個/data檔(注意不是資料夾,跟參數剛好不相匹配),也可以通過網頁中看:


  NameNode 'master:9000'


  Started: Sat Jul 06 09:54:05 PDT 2013


  Version: 1.1.2, r1440782


  Compiled: Thu Jan 31 02:03:24 UTC 2013 by hortonfo


  Upgrades: There are no upgrades in progress.


  Browse the filesystem


Namenode Logs


  解決方法:刪除掉改檔:hadoop fs -rmr /data 即ok


  3、在hadoop中編譯eclipse匯出的jar包時報錯:


  [hadoop@master hadoop-1.1.2]$ hadoop jar hdfs1.jar com.hadoop.hdfs.HDFSMkdir


  Warning: $HADOOP_HOME is deprecated.


  Exception in thread "main" java.lang.UnsupportedClassVersionError: com/hadoop/hdfs/HDFSMkdir : Unsupported major.m inor version 51.0


  原因:eclipse中所用java版本與hadoop所用java版本不一致。


  解決方法:更改eclipse中的java版本重新匯出jar包。
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.