What's the native snappy library when running jar with Hadoop

独自空忆成欢 提交于 2019-12-12 03:15:33

问题


There is an Error as notice below when I ran a MapReduce jar in Centos 6.4 .

Hadoop Version is 2.6.0 for 64 bit.

The MapReduce failed,how can I solve this?

Error: java.lang.RuntimeException: native snappy library not available: this version of libhadoop was built without snappy support.
    at org.apache.hadoop.io.compress.SnappyCodec.checkNativeCodeLoaded(SnappyCodec.java:64)
    at org.apache.hadoop.io.compress.SnappyCodec.getCompressorType(SnappyCodec.java:133)
    at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:148)
    at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:163)
    at org.apache.hadoop.io.SequenceFile$Writer.init(SequenceFile.java:1199)
    at org.apache.hadoop.io.SequenceFile$Writer.<init>(SequenceFile.java:1092)
    at org.apache.hadoop.io.SequenceFile$BlockCompressWriter.<init>(SequenceFile.java:1442)
    at org.apache.hadoop.io.SequenceFile.createWriter(SequenceFile.java:275)
    at org.apache.hadoop.io.SequenceFile.createWriter(SequenceFile.java:528)
    at org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat.getSequenceWriter(SequenceFileOutputFormat.java:64)
    at org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat.getRecordWriter(SequenceFileOutputFormat.java:75)
    at org.apache.hadoop.mapred.ReduceTask$NewTrackingRecordWriter.<init>(ReduceTask.java:540)
    at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:614)
    at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:389)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
    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:1628)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)

回答1:


You need to compile hadoop source code for native libraries. Step by step instructions are provided here.

The video covers validation, compiling the code using maven and using the native libraries.



来源:https://stackoverflow.com/questions/34194038/whats-the-native-snappy-library-when-running-jar-with-hadoop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!