在Win7 環境使用Java API 上傳檔案到 Hadoop2.x HDFS 問題統計

來源:互聯網
上載者:User

標籤:

 

問題一:

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 問題統計

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.