[root@slave1 lib]# pwd
/usr/local/lib
[root@slave1 lib]# ll
total 536
-rw-r--r--. 1 root root 369308 Jan 14 11:02 libsnappy.a
-rwxr-xr-x. 1 root root 957 Jan 14 11:02 libsnappy.la
lrwxrwxrwx. 1 root root 18 Jan 14 11:02 libsnappy.so -> libsnappy.so.1.1.3
lrwxrwxrwx. 1 root root 18 Jan 14 11:02 libsnappy.so.1 -> libsnappy.so.1.1.3
-rwxr-xr-x. 1 root root 171796 Jan 14 11:02 libsnappy.so.1.1.3
[root@slave1 lib]#
如果没有错误且文件及链接一致,snappy的安装已经成功。 3. Hadoop Snappy 源码编译过程及问题解决方案① 下载Hadoop-Snappy源码
下载地址:http://code.google.com/p/hadoop-snappy/
② 编译hadoop snappy源码
mvn package [-Dsnappy.prefix=SNAPPY_INSTALLATION_DIR]
注:如果第二步snappy安装路径是默认的话,即/usr/local/lib,则此处 [-Dsnappy.prefix=SNAPPY_INSTALLATION_DIR] 可以不写,或者 -Dsnappy.prefix=/usr/local/lib
这个过程如果你的CentOS各个软件的版本正好和Hadoop Snappy要求的一致的话,真的恭喜你,可以一部成功,但是有些还是会有问题。我遇到的三个比计较棘手的问题:
错误一:/root/modules/hadoop-snappy/maven/build-compilenative.xml:62: Execute failed: java.io.IOException: Cannot run program “autoreconf” (in directory “/root/modules/hadoop-snappy/target/native-src”): java.io.IOException: error=2, No such file or directory
解决方案:说明缺少文件,但是这个文件是在target下的,是编译过程中自动生成的,原本就不该存在,这是问什么呢?其实根本问题不是缺文件,而是Hadoop Snappy是需要一定的前置条件的:Requirements: gcc c++, autoconf, automake, libtool, Java 6, JAVA_HOME set, Maven 3。
我这里边缺少了autoconf,automake,libtool的缘故。在ubuntu中,你可以直接依次apt-get install autoconf,automake,libtool即可,如果是在CentOS中,只需将apt-get 换成 yum。
错误二:
[exec] make: *** [src/org/apache/hadoop/io/compress/snappy/SnappyCompressor.lo] Error 1
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (compile) on project hadoop-snappy: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] /home/ngc/Char/snap/hadoop-snappy/hadoop-snappy-read-only/maven/build-compilenative.xml:75: exec returned: 2
[root@master modules]# gcc --version
gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
<property>
<name>mapred.output.compress</name>
<value>false</value>
<description>Should the job outputs be compressed?
</description>
</property>
<property>
<name>mapred.output.compression.type</name>
<value>RECORD</value>
<description>If the job outputs are to compressed as SequenceFiles, how should
they be compressed? Should be one of NONE, RECORD or BLOCK.
</description>
</property>
<property>
<name>mapred.output.compression.codec</name>
<value>org.apache.hadoop.io.compress.DefaultCodec</value>
<description>If the job outputs are compressed, how should they be compressed?
</description>
</property>
<property>
<name>mapred.compress.map.output</name>
<value>false</value>
<description>Should the outputs of the maps be compressed before being
sent across the network. Uses SequenceFile compression.
</description>
</property>
<property>
<name>mapred.map.output.compression.codec</name>
<value>org.apache.hadoop.io.compress.DefaultCodec</value>
<description>If the map outputs are compressed, how should they be
compressed?
</description>
</property>
安装成功 并在hadoop配置后 运行一个mapreduce报错
Error: java.lang.RuntimeException: native snappy library not available: this version of libhadoop was built without snappy support.
请问这是什么原因 哪里配置不对吗