[root@node1 ~]# ping www.baidu.com
PING www.a.shifen.com (61.135.169.121) 56(84) bytes of data.
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=1 ttl=128 time=21.2 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=2 ttl=128 time=20.0 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=3 ttl=128 time=22.1 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=4 ttl=128 time=17.1 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=5 ttl=128 time=20.2 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=6 ttl=128 time=21.8 ms
**尖叫提示:采用****root****角色编译,减少文件夹权限出现问题**
hadoop版本>=2.7:要求Java 7(openjdk/oracle)
hadoop版本<=2.6:要求Java 6(openjdk/oracle)
(1)hadoop-2.8.2-src.tar.gz
(2)jdk-7u79-linux-x64.gz
(3)apache-ant-1.9.9-bin.tar.gz
(4)apache-maven-3.0.5-bin.tar.gz
(5)protobuf-2.5.0.tar.gz
(6)snappy-1.1.3.tar.gz
Jdk解压、配置环境变量 JAVA_HOME和PATH
[root@node1 software]# tar -xzvf jdk-7u79-linux-x64.gz -C /opt/module/
[root@node1 software]# vi /etc/profile
#JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.7.0_79
export PATH=$PATH:$JAVA_HOME/bin
[root@node1 software]# source /etc/profile
[root@node1 software]# java -version
**尖叫提示:所有操作必须在****root****用户下完成**
Maven解压、配置环境变量 MAVEN_HOME和PATH
[root@node1 software]# tar -xzvf apache-maven-3.0.5-bin.tar.gz -C /opt/module/
[root@node1 software]# vi /etc/profile
#MAVEN_HOME
export MAVEN_HOME=/opt/module/apache-maven-3.0.5
export PATH=$PATH:$MAVEN_HOME/bin
[root@node1 software]# source /etc/profile
[root@node1 software]# mvn -version
ant解压、配置环境变量 ANT_HOME和PATH
[root@node1 software]# tar -zxvf apache-ant-1.9.9-bin.tar.gz -C /opt/module/
[root@node1 software]# vi /etc/profile
#ANT_HOME
export ANT_HOME=/opt/module/apache-ant-1.9.9
export PATH=$PATH:$ANT_HOME/bin
[root@node1 software]# source /etc/profile
[root@node1 software]# ant -version
[root@node1 software]# yum install glibc-headers
[root@node1 software]# yum install gcc-c++
[root@node1 software]# yum install make
[root@node1 software]# yum install cmake
protobuf解压、编译、安装、配置环境变量 LD_LIBRARY_PATH和PATH
[root@node1 software]# tar -xzvf protobuf-2.5.0.tar.gz -C /opt/module/
[root@node1 software]# cd /opt/module/protobuf-2.5.0/
[root@node1 protobuf-2.5.0]# ./configure
[root@node1 protobuf-2.5.0]# make
[root@node1 protobuf-2.5.0]# make check
[root@node1 protobuf-2.5.0]# make install
[root@node1 protobuf-2.5.0]# ldconfig
[root@node1 protobuf-2.5.0]# vi /etc/profile
#LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/module/protobuf-2.5.0
export PATH=$PATH:$LD_LIBRARY_PATH
[root@node1 protobuf-2.5.0]# source /etc/profile
[root@node1 protobuf-2.5.0]# protoc --version
[root@node1 software]# yum install openssl-devel
[root@node1 software]# yum install ncurses-devel
[root@node1 software]# yum install svn
[root@node1 software]# yum install autoconf automake libtool cmake
[root@node1 software]# yum install gcc*
snappy解压、编译、安装
[root@node1 software]# tar -xzvf snappy-1.1.3.tar.gz -C /opt/module/
[root@node1 software]# cd /opt/module/snappy-1.1.3/
[root@node1 snappy-1.1.3]# ./configure
[root@node1 snappy-1.1.3]# make
[root@node1 snappy-1.1.3]# make install
#查看snappy库文件
[root@node1 snappy-1.1.3]# ls -lh /usr/local/lib |grep snappy
protobuf 解压、编译、安装
[root@node1 software]# tar -xzvf protobuf-2.5.0.tar.gz -C /opt/module/
[root@node1 software]# cd /opt/module/ protobuf-2.5.0/
[root@node1 protobuf-2.5.0]# ./configure
[root@node1 protobuf-2.5.0]# make
[root@node1 protobuf-2.5.0]# make install
查看protobuf版本是否安装成功
[root@node1 protobuf-2.5.0]# protoc --version
Hadoop 源码解压、编译
[root@node1 software]# tar -xzvf hadoop-2.8.2-src.tar.gz -C /opt/module
[root@node1 software]# cd /opt/module/hadoop-2.8.2-src
[root@node1 hadoop-2.8.2-src]# mvn clean package -DskipTests -Pdist,native -Dtar -Dsnappy.lib=/usr/local/lib -Dbundle.snappy
等待时间20分钟左右,最终成功是全部SUCCESS执行成功后,/opt/module /hadoop-2.8.2-src/hadoop-dist/target/hadoop-2.8.2.tar.gz即为新生成的支持snappy压缩的hadoop二进制安装包,
编译期间maven报错,可能网络阻塞问题导致依赖库下载不完整导致,多次执行命令(一次通过比较难)
编译期间maven报错,可能网络阻塞问题导致依赖库下载不完整导致,多次执行命令(一次通过比较难)
1)修改maven仓库地址
[root@node1 ~]# cd /opt/module/apache-maven-3.0.5/conf
[root@node1 conf]# pwd
/opt/module/apache-maven-3.0.5/conf
[root@node1 conf]# vim settings.xml
/opt/module/apache-maven-3.0.5/repository
2)修改maven镜像,下载大部分依赖库后,再删除添加的镜像,否则有的依赖库下载不下来
nexus-aliyun
Nexus aliyun
http://maven.aliyun.com/nexus/content/groups/public/
central
repo2
Mirror from Maven Repo2
http://repo2.maven.org/maven2/
central
centor
Mirror from Maven central
http://central.maven.org/maven2/
central