2013-03-10 116 views
1

有誰知道如何解決此錯誤? 我讀過,我可以在fileutils.setPermission中編輯並刪除checkReturnValue的行,但我不知道如何。Wordcount示例錯誤

13/03/10 13:04:14 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 
13/03/10 13:04:14 ERROR security.UserGroupInformation: PriviledgedActionException as:Nesreen.Mamdouh cause:java.io.IOException: Failed to set permissions of path: \tmp\hadoop-Nesreen.Mamdouh\mapred\staging\Nesreen.Mamdouh64097525\.staging to 0700 
Exception in thread "main" java.io.IOException: Failed to set permissions of path: \tmp\hadoop-Nesreen.Mamdouh\mapred\staging\Nesreen.Mamdouh64097525\.staging to 0700 
at org.apache.hadoop.fs.FileUtil.checkReturnValue(FileUtil.java:689) 
at org.apache.hadoop.fs.FileUtil.setPermission(FileUtil.java:662) 
at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:509) 
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:344) 
at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:189) 
at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:116) 
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:856) 
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850) 
at java.security.AccessController.doPrivileged(Native Method) 
at javax.security.auth.Subject.doAs(Unknown Source) 
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) 
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850) 
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:824) 
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1261) 
at BigDataPackage.WordCount.main(WordCount.java:55) 
+0

你能爲我們提供更多的背景信息嗎?什麼行導致這個錯誤? '\ tmp \ hadoop-Nesreen.Mamdouh \ mapred \ staging \ Nesreen.Mamdouh64097525 \ .staging'的當前權限是什麼?哪個用戶執行該程序? – Griddo 2013-03-10 12:15:26

回答

0

我相信你在Windows上運行這個程序。我相信有類似的問題就解決了here

檢查Windows的Hadoop的安裝一些信息here

+0

和得到此錯誤的代碼部分是:JobClient.runJob(conf);它的hadoop穩定版本1.0.4和\ tmp \ hadoop-Nesreen.Mamdouh \ mapred \ staging \ Nesreen.Mamdouh64097525 \ .staging的權限設置爲每個擁有完全訪問權限的用戶,並且以管理員身份運行eclipse, 另外我還沒有安裝Cygwin。 – Nesreen 2013-03-10 14:29:28

+0

和即時通訊在Windows上運行 – Nesreen 2013-03-10 14:50:24

0

您可以使用下面的變通方法來制止這種錯誤:

  1. 在你的Hadoop目錄去SRC - >核 - > org-> apache-> hadoop-> FS
  2. 打開FileUtil.Java
  3. 註釋列於線checkReturnValue函數內的代碼685
  4. 重新創建hadoop-core-1.0.4.jar並將其包含在eclipse項目的構建路徑中。

這應該解決問題。

+0

我可以得到以下步驟,請你詳細說明。 重新創建hadoop-core-1.0.4.jar並將其包含在eclipse項目的構建路徑中。 – Nesreen 2013-03-11 09:49:45