我只是想在我的笔记本电脑上运行64位Windows 7的独立模式下运行Hadoop。我已经在默认文件夹(c:\ cygwin)中安装了Cygwin 1.7。我在文件夹c:\ jdk1.7.0_03中有最新的JDK,并设置了JAVA_HOME环境变量。
当我尝试从cygwin提示符运行以下命令时:
$ bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'
这是我得到的错误:
12/03/17 19:08:43 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
java.io.IOException: Failed to set permissions of path: \tmp\hadoop-ehtzrhf\mapred\staging\ehtzrhf837602798\.staging to 0700
at org.apache.hadoop.fs.FileUtil.checkReturnValue(FileUtil.java:682)
at org.apache.hadoop.fs.FileUtil.setPermission(FileUtil.java:655)
at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:484)
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:319)
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:848)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:842)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:842)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:816)
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1253)
at org.apache.hadoop.examples.Grep.run(Grep.java:69)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.examples.Grep.main(Grep.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
我已尝试过Hadoop 1.0.1和hadoop-0.20.205.0并得到同样的问题。我用
更新了我的.bashrcexport TMP=/cygdrive/c/temp
export TEMP=/cygdrive/c/temp
我还在路径中添加了cygwin bin文件夹:
export PATH=.:/cygdrive/c/cygwin/bin:$HADOOP_INSTALL/bin
我也觉得很奇怪它将路径显示为\ tmp ...而不是/ tmp /...
没有重新编译或运行Linux VM,有什么想法吗?
答案 0 :(得分:7)
这是一个简单易用的解决方法,不需要任何牦牛剃须:
答案 1 :(得分:2)
固定(主要牦牛剃须)
https://issues.apache.org/jira/browse/HADOOP-7682?focusedCommentId=13236645#comment-13236645
答案 2 :(得分:0)
我已经设法让这个工作到了调度作业,执行任务和编译结果的程度。
但是我们仍然需要让servlet了解cygwin符号链接。我不知道如何在Jetty中做到这一点。
这两个链接显示了如何允许Tomcat和jetty遵循符号链接,但我不知道这是否适用于cygwin。 * http://www.lamoree.com/machblog/index.cfm?event=showEntry&entryId=A2F0ED76-A500-41A6-A1DFDE0D1996F925 * Configure Symlinks for single directory in Tomcat
否则我们必须打开jetty代码并用org.apache.hadoop.fs.LinkedFile替换java.io.File。