CentOS 7.4下编译安装Hadoop 2.7.6 及所需文件

1. 使用系统和软件

操作系统:CentOS Linux release 7.4.1708 (Core)  64位
使用软件如下:
jdk1.8.0_112.tar.gz
Hadoop-2.7.6-src.tar.gz
apache-ant-1.9.11-bin.tar.gz
apache-maven-3.5.3-bin.tar.gz
findbugs-3.0.1.tar.gz
protobuf-2.5.0.tar.gz

2. 必要的包安装
[root@mini05 ~]# yum install -y cmake
[root@mini05 ~]# yum install -y openssl-devel
[root@mini05 ~]# yum install -y ncurses-devel 

3. 安装Jdk【java8】
3.1.  软件安装
[root@mini05 software]# pwd
/app/software
[root@mini05 software]# tar xf jdk1.8.0_112.tar.gz
[root@mini05 software]# ll
total 201392
drwxr-xr-x 8  10  143      4096 Dec 20 13:27 jdk1.8.0_112
-rw-r--r-- 1 root root 189815615 Mar 12 16:47 jdk1.8.0_112.tar.gz
[root@mini05 software]# mv jdk1.8.0_112/ /app/
[root@mini05 software]# cd /app/
[root@mini05 app]# ln -s jdk1.8.0_112/ jdk
[root@mini05 app]# ll
total 8
lrwxrwxrwx  1 root root    13 May 16 23:19 jdk -> jdk1.8.0_112/
drwxr-xr-x  8  10  143 4096 Dec 20 13:27 jdk1.8.0_112

3.2.  环境变量
[root@mini05 ~]$ pwd
/app
[root@mini05 ~]$ ll -d jdk*  # 可以根据实际情况选择jdk版本,其中jdk1.8 可以兼容 jdk1.7 
lrwxrwxrwx 1 yun yun  11 Mar 15 14:58 jdk -> jdk1.8.0_112
drwxr-xr-x 8 yun yun 4096 Dec 20 13:27 jdk1.8.0_112
[root@mini05 profile.d]$ pwd
/etc/profile.d
[root@mini05 profile.d]$ cat jdk.sh # java环境变量 
export JAVA_HOME=/app/jdk
export JRE_HOME=/app/jdk/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
 
[root@mini05 profile.d]# source /etc/profile
[root@mini05 profile.d]$ java -version 
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

4. 安装maven
4.1.  软件安装
[root@mini05 software]# pwd
/app/software
[root@mini05 software]# tar xf apache-maven-3.5.3-bin.tar.gz
[root@mini05 software]# mv apache-maven-3.5.3 /app/
[root@mini05 software]# cd /app/
[root@mini05 app]# ln -s apache-maven-3.5.3 maven
[root@mini05 app]# ll
total 0
drwxr-xr-x 6 root root  99 Jun  8 10:18 apache-maven-3.5.3
lrwxrwxrwx 1 yun  yun  13 Jun  7 22:49 jdk -> jdk1.8.0_112/
drwxr-xr-x 8 yun  yun  255 Sep 23  2016 jdk1.8.0_112
lrwxrwxrwx 1 root root  18 Jun  8 10:19 maven -> apache-maven-3.5.3
drwxrwxr-x 2 yun  yun  222 Jun  8 10:18 software

4.2.  环境变量
[root@mini05 profile.d]# pwd
/etc/profile.d
[root@mini05 profile.d]# cat maven.sh
export MAVEN_HOME=/app/maven/
export PATH=$MAVEN_HOME/bin:$PATH
 
[root@mini05 profile.d]# source /etc/profile
[root@mini05 profile.d]# mvn -v 
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: /app/maven
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: /app/jdk1.8.0_112/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-693.el7.x86_64", arch: "amd64", family: "unix"

5. 安装ant
5.1.  软件安装
[root@mini05 software]# pwd
/app/software
[root@mini05 software]# tar xf apache-ant-1.9.11-bin.tar.gz 
[root@mini05 software]# mv apache-ant-1.9.11 /app/
[root@mini05 app]# ln -s apache-ant-1.9.11 ant 
[root@mini05 app]# ll
total 0
lrwxrwxrwx 1 root root  17 Jun  8 10:38 ant -> apache-ant-1.9.11
drwxr-xr-x 6 root root 235 Mar 24 01:08 apache-ant-1.9.11
drwxr-xr-x 6 root root  99 Jun  8 10:18 apache-maven-3.5.3
lrwxrwxrwx 1 yun  yun  13 Jun  7 22:49 jdk -> jdk1.8.0_112/
drwxr-xr-x 8 yun  yun  255 Sep 23  2016 jdk1.8.0_112
lrwxrwxrwx 1 root root  18 Jun  8 10:19 maven -> apache-maven-3.5.3
drwxrwxr-x 2 yun  yun  222 Jun  8 10:18 software

5.2.  环境变量
[root@mini05 profile.d]# pwd
/etc/profile.d
[root@mini05 profile.d]# vim ant.sh
export ANT_HOME="/app/ant"
export PATH=$ANT_HOME/bin:$PATH
 
[root@mini05 profile.d]# source /etc/profile 
[root@mini05 profile.d]# ant -version 
Apache Ant(TM) version 1.9.11 compiled on March 23 2018

6. 安装findbugs
6.1.  软件安装
[root@mini05 software]# pwd
/app/software
[root@mini05 software]# tar xf findbugs-3.0.1.tar.gz
[root@mini05 software]# mv findbugs-3.0.1 /app/
[root@mini05 software]# cd /app/
[root@mini05 app]# ln -s findbugs-3.0.1/ findbugs 
[root@mini05 app]# ll
total 0
lrwxrwxrwx 1 root root  17 Jun  8 10:38 ant -> apache-ant-1.9.11
drwxr-xr-x 6 root root 235 Mar 24 01:08 apache-ant-1.9.11
drwxr-xr-x 6 root root  99 Jun  8 10:18 apache-maven-3.5.3
lrwxrwxrwx 1 root root  15 Jun  8 11:01 findbugs -> findbugs-3.0.1/
drwxr-xr-x 8 root root 104 Jun  8 11:00 findbugs-3.0.1
lrwxrwxrwx 1 yun  yun  13 Jun  7 22:49 jdk -> jdk1.8.0_112/
drwxr-xr-x 8 yun  yun  255 Sep 23  2016 jdk1.8.0_112
lrwxrwxrwx 1 root root  18 Jun  8 10:19 maven -> apache-maven-3.5.3
drwxrwxr-x 2 yun  yun  222 Jun  8 11:01 software

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/c3721fea881df960180f0c6e7eb7b697.html