这篇文章主要介绍“Hadoop HBase配置安装Snappy的详细教程”,在日常操作中,相信很多人在Hadoop HBase配置安装Snappy的详细教程问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Hadoop HBase配置安装Snappy的详细教程”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!本篇文章主要包括:1. Snappy 压缩算法介绍及集中压缩算法比较2. Snappy 安装过程及验证3. Hadoop Snappy 源码编译过程及问题解决方案4. Hadoop上Hadoop Snappy 安装配置过程及验证5. HBase 配置Snappy及验证6.如何在集群中所有节点部署废话不多说,现在开始:这一部分可以参考我的上一篇博文:Hadoop压缩-SNAPPY算法,或者直接参看Google文档:http://code.google.com/p/snappy/及http://code.google.com/p/hadoop-snappy/。不再详细介绍。①前置条件gcc c++, autoconf, automake, libtool, Java 6, JAVA_HOME set, Maven 3前五个如果不能确定的话,可以直接使用yum install XXX来确认一下,如果已安装会提示,没有安装的话,会自动安装上。②下载Snappy 1.0.5下载地址:http://code.google.com/p/snappy/downloads/list。③ 编译并安装动态链接库到本地?123./configuremakemake install默认是安装到了/usr/local/lib。这时在此目录下查看会生成:?12345678910[root@slave1 lib]# pwd/usr/local/lib[root@slave1 lib]# lltotal 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.lalrwxrwxrwx. 1 root root 18 Jan 14 11:02 libsnappy.so -> libsnappy.so.1.1.3lrwxrwxrwx. 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的安装已经成功。① 下载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。错误二:?1234[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: A免费主机域名n 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解决方案:这个是最恶心的。Hadoop Snappy的前置条件需要安装gcc,但是它的官方文档仅仅列出了需要gcc,而没有列出需要什么版本的gcc。在Google中英文搜索了半天,刨来刨去,终于发现,有句话说Hadoop Snappy是需要gcc4.4的。而我的是gcc4.6.3。?12345[root@master modules]# gcc –versiongcc (G免费主机域名CC) 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 NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.那么我们就要回退,如何回退:?12345671. apt-get install gcc-3.42. rm /usr/bin/gcc3. ln -s /usr/bin/gcc-4.4 /usr/bin/gcc之后,再gcc –version,你就会发现,gcc已经变成4.4.7了。错误三:?12345[exec] /bin/bash ./libtool –tag=CC –mode=link gcc -g -Wall -fPIC -O2 -m64 -g -O2 -version-info 0:1:0 -L/usr/local//lib -o libhadoopsnappy.la -rpath /usr/local/lib src/org/apache/hadoop/io/compress/snappy/SnappyCompressor.lo src/org/apache/hadoop/io/compress/snappy/SnappyDecompressor.lo -ljvm -ldl[exec] /usr/bin/ld: cannot find -ljvm[exec] collect2: ld returned 1 exit status[exec] make: *** [libhadoopsnappy.la] 错误 1[exec] libtool: link: gcc -shared -fPIC -DPIC src/org/apache/hadoop/io/compress/snappy/.libs/SnappyCompressor.o src/org/apache/hadoop/io/compress/snappy/.libs/SnappyDecompressor.o -L/usr/local//lib -ljvm -ldl -O2 -m64 -O2 -Wl,-soname -Wl,libhadoopsnappy.so.0 -o .libs/libhadoopsnappy.so.0.0.1解决方案:如果你去搜,你会发现网上有很多 解决/usr/bin/ld:cannotfind-lxxx 这样的博客,但是这里,我告诉你,他们的都不适用。因为这儿既不是缺什么,也不是版本不对,是因为没有把安装jvm的libjvm.so symbolic link到usr/local/lib。如果你的系统时amd64,可到/root/bin/jdk1.6.0_37/jre/lib/amd64/server/察看libjvm.so link到的地方,这里修改如下:ln -s /root/bin/jdk1.6.0_37/jre/lib/amd64/server/libjvm.so /usr/local/lib/问题即可解决。③ hadoop snappy源码编译成功以后,在target包下,会有如下文件:?12345678910111213141516171819[root@master snappy-hadoop]# cd target/[root@master target]# lltotal 928drwxr-xr-x. 2 root root 4096 Jan 13 19:42 antrundrwxr-xr-x. 2 root root 4096 Jan 13 19:44 archive-tmpdrwxr-xr-x. 3 root root 4096 Jan 13 19:42 classes-rw-r–r–. 1 root root 168 Jan 13 19:44 copynativelibs.shdrwxr-xr-x. 4 root root 4096 Jan 13 19:42 generated-sources-rw-r–r–. 1 root root 11526 Jan 13 19:44 hadoop-snappy-0.0.1-SNAPSHOT.jar-rw-r–r–. 1 root root 337920 Jan 13 19:44 hadoop-snappy-0.0.1-SNAPSHOT-Linux-amd64-64.tardrwxr-xr-x. 3 root root 4096 Jan 13 19:44 hadoop-snappy-0.0.1-SNAPSHOT-tar-rw-r–r–. 1 root root 180661 Jan 13 19:44 hadoop-snappy-0.0.1-SNAPSHOT.tar.gzdrwxr-xr-x. 2 root root 4096 Jan 13 19:44 maven-archiverdrwxr-xr-x. 3 root root 4096 Jan 13 19:42 native-builddrwxr-xr-x. 7 root root 4096 Jan 13 19:42 native-srcdrwxr-xr-x. 2 root root 4096 Jan 13 19:44 surefire-reportsdrwxr-xr-x. 3 root root 4096 Jan 13 19:42 test-classes-rw-r–r–. 1 root root 365937 Jan 13 19:44 test.txt.snappy[root@master target]#这个过程也比较繁杂,配置点比较多要仔细:① 解压第三步target下hadoop-snappy-0.0.1-SNAPSHOT.tar.gz,解压后,复制lib文件?1cp -r /root/modules/snappy-hadoop/target/hadoop-snappy-0.0.1-SNAPSHOT/lib/native/Linux-amd64-64/* $HADOOP_HOME/lib/native/Linux-amd64-64/② 将第三步target下的hadoop-snappy-0.0.1-SNAPSHOT.jar复制到$HADOOP_HOME/lib 下。③ 配置hadoop-env.sh,添加:?1export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HADOOP_HOME/lib/native/Linux-amd64-64/:/usr/local/lib/④ 配置mapred-site.xml,这个文件中,所有跟压缩有关的配置选项有:?12345678910111213141516171819202122232425262728293031323334353637
这篇文章主要讲解了“centos6源码安装mysql8的步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“centos6源码安装mysql8的步骤”吧!一,因为mysql 8 的编译要求gcc 4.9以上,所以…