无法为您的平台加载native-hadoop库...未加载Snappy本机库

时间:2013-09-06 11:39:57

标签: java apache hadoop localhost

当我通过cygwin在hadoop上运行此命令时:

$bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'

我收到以下错误:

13/09/06 17:06:04 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
13/09/06 17:06:04 WARN snappy.LoadSnappy: Snappy native library not loaded
13/09/06 17:06:05 INFO mapred.FileInputFormat: Total input paths to process : 18
13/09/06 17:06:05 INFO mapred.JobClient: Cleaning up the staging area hdfs://localhost:9000/tmp/hadoop-cyg_server/mapred/staging/cyg_server/.staging/job_201309061646_0003
13/09/06 17:06:05 ERROR security.UserGroupInformation: PriviledgedActionException as:cyg_server cause:java.io.IOException: Not a file: hdfs://localhost:9000/user/cyg_server/input/conf
java.io.IOException: Not a file: hdfs://localhost:9000/user/cyg_server/input/conf
        at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:215)
        at org.apache.hadoop.mapred.JobClient.writeOldSplits(JobClient.java:1081)
        at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:1073)
        at org.apache.hadoop.mapred.JobClient.access$700(JobClient.java:179)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:983)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
        at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
        at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:910)
        at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1353)
        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:491)
        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:491)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:160)

请告诉我解决方案“无法为您的平台加载native-hadoop库...没有加载Snappy本地库”

1 个答案:

答案 0 :(得分:0)

http://hadoop.apache.org/docs/stable/native_libraries.html

“本地hadoop库仅在* nix平台上受支持。该库不能与Cygwin或Mac OS X平台一起使用。”