1. 程式人生 > >Hadoop原始碼編譯之linux工具安裝

Hadoop原始碼編譯之linux工具安裝

Hadoop原始碼編譯之linux工具安裝

1.JDK解壓、配置環境變數 JAVA_HOME和PATH,驗證java-version(如下都需要驗證是否配置成功)

1.執行解壓命令:[[email protected] software] # tar -zxf jdk-8u144-linux-x64.tar.gz -C /opt/module/
2.配置環境變數:[[email protected] software]# vi /etc/profile
新增如下內容:

#JAVA_HOME:
export JAVA_HOME=/opt/module/jdk1.8.0_144
export PATH=$PATH:$JAVA_HOME/bin

3.配置成功後執行命令使其生效:[[email protected] software]# source /etc/profile
4.驗證安裝是否成功命令:java -version
在這裡插入圖片描述

2.Maven解壓、配置 MAVEN_HOME和PATH

1.執行解壓命令:[[email protected] software]# tar -zxvf apache-maven-3.0.5-bin.tar.gz -C /opt/module/
2.修改配置檔案:[[email protected] apache-maven-3.0.5]# vi conf/settings.xml
新增如下內容:

<mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
<mirror>
       <id>mirrorId</id>
       <mirrorOf>repositoryId</mirrorOf>
       <name>Human Readable Name for this Mirror.</name>
       <url>http://my.repository.com/repo/path</url>
      </mirror>
     -->
        <mirror>
                <id>nexus-aliyun</id>
                <mirrorOf>central</mirrorOf>
                <name>Nexus aliyun</name>
                <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </mirror>
</mirrors>

3.新增環境變數:[[email protected] apache-maven-3.0.5]# vi /etc/profile
新增如下內容:

#MAVEN_HOME
export MAVEN_HOME=/opt/module/apache-maven-3.0.5
export PATH=$PATH:$MAVEN_HOME/bin

4.使配置生效:[[email protected] software]# source /etc/profile
5.驗證是否安裝成功:驗證命令:mvn -version
在這裡插入圖片描述

3.ant解壓、配置 ANT _HOME和PATH

1.執行解壓命令:[[email protected] software]# tar -zxvf apache-ant-1.9.9-bin.tar.gz -C /opt/module/
2.新增環境變數:[[email protected] apache-ant-1.9.9]# vi /etc/profile
新增如下內容:

#ANT_HOME
export ANT_HOME=/opt/module/apache-ant-1.9.9
export PATH=$PATH:$ANT_HOME/bin

3.是環境變數生效:[[email protected] software]# source /etc/profile
4.驗證是否安裝成功命令:ant -version
在這裡插入圖片描述

4.安裝 glibc-headers 和 g++

1.執行命令:[[email protected] apache-ant-1.9.9]# yum install glibc-headers
2.執行命令:[[email protected] apache-ant-1.9.9]# yum install gcc-c++

5.安裝make和cmake

1.執行命令:[[email protected] apache-ant-1.9.9]# yum install make
2.執行命令:[[email protected] apache-ant-1.9.9]# yum install cmake

6.安裝libprotoc,進入到解壓後protobuf主目錄,/opt/module/protobuf-2.5.0,然後相繼執行命令

1.執行解壓命令:[[email protected] software]# tar -zxvf protobuf-2.5.0.tar.gz -C /opt/module/

2.切換目錄:[[email protected] opt]# cd /opt/module/protobuf-2.5.0/

3.執行命令:[[email protected] protobuf-2.5.0]#./configure

4.執行命令:[[email protected] protobuf-2.5.0]# make

5.執行命令:[[email protected] protobuf-2.5.0]# make check

6.執行命令:[[email protected] protobuf-2.5.0]# make install

7.執行命令:[[email protected] protobuf-2.5.0]# ldconfig

8.配置系統環境:[[email protected] hadoop-dist]# vi /etc/profile
新增如下內容:

#LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/module/protobuf-2.5.0
export PATH=$PATH:$LD_LIBRARY_PATH

9.使環境變數生效:[[email protected] software]#source /etc/profile
10.驗證是否成功:protoc --version
在這裡插入圖片描述

7.安裝openssl庫

執行命令:[[email protected] software]#yum install openssl-devel

8.安裝 ncurses-devel庫

執行命令:[[email protected] software]#yum install ncurses-devel

9.關聯(請先看這篇):

https://blog.csdn.net/qq_39657909/article/details/84975762

版權宣告:本部落格為記錄本人自學感悟,轉載需註明出處!
https://me.csdn.net/qq_39657909