標籤:
問題一:
org.apache.hadoop.security.AccessControlException: org.apache.hadoop.security .AccessControlException: Permission denied: user=Administrator, access=WRITE, inode="hadoop": hadoop:supergroup:rwxr-xr-x
解決方案:
在本地系統(WIN7)的環境變數或java JVM變數裡面添加HADOOP_USER_NAME,這個值具體等於多少看自己的情況,以後會運行HADOOP上的Linux的使用者名稱。(修改完重啟eclipse,不然可能不生效)
參考資料:
http://www.linuxidc.com/Linux/2014-08/105335.htm
http://www.linuxidc.com/Linux/2014-08/105335p2.htm
問題二:
WIN7下運行hadoop程式報:Failed to locate the winutils binary in the hadoop binary path
2015-07-06 17:32:26,455 ERROR [main] util.Shell (Shell.java:getWinUtilsPath(336)) -
Failed to locate the winutils binary in the hadoop binary pathjava.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries. at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:318) at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:333) at org.apache.hadoop.util.Shell.<clinit>(Shell.java:326)
解決方案:
1.下載winutils的windows版本
GitHub上,有人提供了winutils的windows的版本,項目地址是:https://github.com/srccodes/hadoop-common-2.2.0-bin ,直接下載此項目的zip包,下載後是檔案名稱是hadoop-common-2.2.0-bin-master.zip,隨便解壓到一個目錄
2.配置環境變數
增加使用者變數HADOOP_HOME,值是下載的zip包解壓的目錄,然後在系統變數path裡增加$HADOOP_HOME\bin 即可。
再次運行程式,正常執行。
參考資料:
http://www.tuicool.com/articles/iABZJj
在Win7 環境使用Java API 上傳檔案到 Hadoop2.x HDFS 問題統計