snappy压缩算法详解(hive存储格式和压缩格式)

Hadoop3编译安装

基础环境:Centos 7.7

编译环境软件安装目录

mkdir -p /export/server

Hadoop编译安装

安装编译相关的依赖

1、yum install gcc gcc-c++ -y#下面这个命令不需要执行 手动安装cmake2、yum install make cmake  #(这里cmake版本推荐为3.6版本以上,版本低源码无法编译!可手动安装)3、yum install autoconf automake libtool curl -y4、yum install lzo-devel zlib-devel openssl openssl-devel ncurses-devel -y5、yum install snappy snappy-devel bzip2 bzip2-devel lzo lzo-devel lzop libXtst -y

手动安装cmake

#yum卸载已安装cmake 版本低yum erase cmake#解压tar zxvf cmake-3.13.5.tar.gz#编译安装cd /export/server/cmake-3.13.5./configuremake && make install#验证[root@node4 ~]# cmake -version      cmake version 3.13.5#如果没有正确显示版本 请断开SSH连接 重写登录

手动安装snappy

#卸载已经安装的cd /usr/local/librm -rf libsnappy*#上传解压tar zxvf snappy-1.1.3.tar.gz #编译安装cd /export/server/snappy-1.1.3./configuremake && make install#验证是否安装[root@node4 snappy-1.1.3]# ls -lh /usr/local/lib |grep snappy-rw-r--r-- 1 root root 511K Nov  4 17:13 libsnappy.a-rwxr-xr-x 1 root root  955 Nov  4 17:13 libsnappy.lalrwxrwxrwx 1 root root   18 Nov  4 17:13 libsnappy.so -> libsnappy.so.1.3.0lrwxrwxrwx 1 root root   18 Nov  4 17:13 libsnappy.so.1 -> libsnappy.so.1.3.0-rwxr-xr-x 1 root root 253K Nov  4 17:13 libsnappy.so.1.3.0

安装配置JDK 1.8

#解压安装包tar zxvf jdk-8u65-linux-x64.tar.gz#配置环境变量vim /etc/profileexport JAVA_HOME=/export/server/jdk1.8.0_65export PATH=$PATH:$JAVA_HOME/binexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarsource /etc/profile#验证是否安装成功java -versionjava version "1.8.0_65"Java(TM) SE Runtime Environment (build 1.8.0_65-b17)Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)You have new mail in /var/spool/mail/root

安装配置maven

#解压安装包tar zxvf apache-maven-3.5.4-bin.tar.gz#配置环境变量vim /etc/profileexport MAVEN_HOME=/export/server/apache-maven-3.5.4export MAVEN_OPTS="-Xms4096m -Xmx4096m"export PATH=:$MAVEN_HOME/bin:$PATHsource /etc/profile#验证是否安装成功[root@node4 ~]# mvn -vApache Maven 3.5.4#添加maven 阿里云仓库地址 加快国内编译速度vim /export/server/apache-maven-3.5.4/conf/settings.xml<mirrors>     <mirror>           <id>alimaven</id>           <name>aliyun maven</name>           <url>http://maven.aliyun.com/nexus/content/groups/public/</url>           <mirrorOf>central</mirrorOf>      </mirror></mirrors>

安装ProtocolBuffer 2.5.0

#解压tar zxvf protobuf-2.5.0.tar.gz#编译安装cd /export/server/protobuf-2.5.0./configuremake && make install#验证是否安装成功[root@node4 protobuf-2.5.0]# protoc --versionlibprotoc 2.5.0

编译hadoop

#上传解压源码包tar zxvf hadoop-3.1.4-src.tar.gz#编译cd /export/server/hadoop-3.1.4-srcmvn clean package -Pdist,native -DskipTests -Dtar -Dbundle.snappy -Dsnappy.lib=/usr/local/lib#参数说明:Pdist,native :把重新编译生成的hadoop动态库;DskipTests :跳过测试Dtar :最后把文件以tar打包Dbundle.snappy :添加snappy压缩支持【默认官网下载的是不支持的】Dsnappy.lib=/usr/local/lib :指snappy在编译机器上安装后的库路径

编译之后的安装包路径

/export/server/hadoop-3.1.4-src/hadoop-dist/target

原创文章,作者:admin,如若转载,请注明出处:https://www.qq65hfghe5.com/tg/85872.html