[root@gis088 hadoop-snappy-master]# cd target [root@gis088 target]# tar -zxvf hadoop-snappy-0.0.1-SNAPSHOT.tar.gz -C /home [root@gis088 target]# cd /home/hadoop-snappy-0.0.1-SNAPSHOT/ [root@gis088 hadoop-snappy-0.0.1-SNAPSHOT]# cp -rf lib/* /home/hadoop-2.8.1/lib [root@gis088 hadoop-snappy-0.0.1-SNAPSHOT]# cd /home/hadoop-2.8.1/lib/native [root@gis088 native]# cp -rf /usr/local/lib/* ./ [root@gis088 native]# ls -al total 5280 drwxrwxr-x. 5 500 500 4096 Mar 19 19:59 . drwxrwxr-x. 3 500 500 60 Mar 19 19:58 .. drwxrwxr-x. 2 500 500 94 Jun 2 2017 examples -rw-rw-r--. 1 500 500 1200084 Jun 2 2017 libhadoop.a -rw-rw-r--. 1 500 500 1487164 Jun 2 2017 libhadooppipes.a lrwxrwxrwx. 1 500 500 18 Jun 3 2017 libhadoop.so -> libhadoop.so.1.0.0 -rwxrwxr-x. 1 500 500 711938 Jun 2 2017 libhadoop.so.1.0.0 -rw-rw-r--. 1 500 500 581808 Jun 2 2017 libhadooputils.a -rw-rw-r--. 1 500 500 365076 Jun 2 2017 libhdfs.a lrwxrwxrwx. 1 500 500 16 Jun 3 2017 libhdfs.so -> libhdfs.so.0.0.0 -rwxrwxr-x. 1 500 500 229297 Jun 2 2017 libhdfs.so.0.0.0 -rw-r--r--. 1 root root 541800 Mar 19 19:59 libsnappy.a -rwxr-xr-x. 1 root root 955 Mar 19 19:59 libsnappy.la lrwxrwxrwx. 1 root root 18 Mar 19 19:59 libsnappy.so -> libsnappy.so.1.3.1 lrwxrwxrwx. 1 root root 18 Mar 19 19:59 libsnappy.so.1 -> libsnappy.so.1.3.1 -rwxr-xr-x. 1 root root 263600 Mar 19 19:59 libsnappy.so.1.3.1 drwxr-xr-x. 3 root root 177 Mar 19 19:58 Linux-amd64-64 drwxr-xr-x. 2 root root 23 Mar 19 19:59 pkgconfig
2,修改core-site.xml和mapred-site.xml配置文件
1
[root@gis088 hadoop]# vim core-site.xml
添加属性:
1 2 3 4 5 6 7 8 9 10
<property> <name>io.compression.codecs</name> <value> org.apache.hadoop.io.compress.GzipCodec, org.apache.hadoop.io.compress.DefaultCodec, org.apache.hadoop.io.compress.BZip2Codec, org.apache.hadoop.io.compress.SnappyCodec </value> <description>A list of the compression codec classes that can be used for compression/decompression.</description> </property>
py4j.protocol.Py4JJavaError: An error occurred while calling o34.collectToPython.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost, executor driver): java.lang.RuntimeException: native snappy library not available: this version of libhadoop was built without snappy support.