hadoop mapreduce: java.lang.UnsatisfiedLinkError: org.apache.hadoop.util.NativeCodeLoader.buildSupportsSnappy()Z

前端 未结 6 1497
暖寄归人
暖寄归人 2020-12-16 04:27

I am trying to write a snappy block compressed sequence file from a map-reduce job. I am using hadoop 2.0.0-cdh4.5.0, and snappy-java 1.0.4.1

Here is my code:

6条回答
  •  孤街浪徒
    2020-12-16 05:07

    My problem was that my JRE did not contain the appropriate native libraries. This may or may not be because I switched the JDK from cloudera's pre-built VM to JDK 1.7. The snappy .so files are in your hadoop/lib/native directory, the JRE needs to have them. Adding them to the classpath did not seem to resolve my issue. I resolved it like this:

    $ cd /usr/lib/hadoop/lib/native
    $ sudo cp *.so /usr/java/latest/jre/lib/amd64/
    

    Then I was able to use the SnappyCodec class. Your paths may be different though.

    That seemed to get me to the next problem:

    Caused by: java.lang.RuntimeException: native snappy library not available: SnappyCompressor has not been loaded.

    Still trying to resolve that.

提交回复
热议问题