1. Configure Yum
2. Installing the JDK
2.1 Uploads
2.2 Unpacking the JDK
#创建文件夹
Mkdir/usr/java
#解压
TAR-ZXVF jdk-7u79-linux-i586.tar.gz-c/usr/java/
2.3 Adding Java to an environment variable
Vim/etc/profile
#在文件最后添加
java_home=/usr/java/jdk1.7.0_79
Export path= $JAVA _home/bin: $PATH
#刷新配置
Source/etc/profile
3. Source code compilation hadoop2.7.0
3.1 Upload hadoop2.7.0 source code
3.2 Installing the Edit source program dependent components
Yum-y Install svn ncurses-devel gcc* lzo-devel zlib-devel autoconf automake libtool openssl–devel
3.3 Installing Ant and Configuring environment variables
Mkdir/usr/ant
TAR-ZXVF apache-ant-1.9.4-bin.tar.gz-c/usr/ant
Vim/etc/profile
ant_home=/usr/ant/apache-ant-1.9.4
export path= $PATH: $ANT _home/bin
Source/etc/profile
Ant-version--See if the installation was successful
3.4 Installing findbugs and configuring environment variables
Mkdir/usr/findbugs
AR-ZXVF findbugs-3.0.0.tar.gz-c/usr/findbugs/
Vim/etc/profile
findbugs_home=/usr/findbugs/findbugs-3.0.0
Export path= $PATH: $FINDBUGS _home/bin
Source/etc/profile
3.5 Installing PROTOBUF
TAR-ZXVF protobuf-2.5.0.tar.gz
CD protobuf-2.5.0
./configure--prefix=/usr/local
Make && make install
Protoc--version--see if the installation was successful
3.6 Installing MAVEN and configuring environment variables
TAR-ZXVF apache-maven-3.2.3-bin.tar.gz-c/usr/maven/
Vim/etc/profile
maven_home=/usr/maven/apache-maven-3.2.3
export path= $PATH: $MAVEN _home/bin
Source/etc/profile
Mvn-version--See if the installation was successful
3.7 Installing CMake
: http://www.cmake.org/cmake/resources/software.html
Installation Prerequisites
The system already has g++ and ncurses-devel installed, if not installed using the following command
[email protected]/]# Yum install gcc-c++
[email protected]/]# Yum install Ncurses-devel
Upload the cmake-2.8.10.2.tar.gz file to the/usr/local to do the following:
[Email protected] local]# cd/usr/local
[[email protected] local]# tar-zxv-f cmake-2.8.10.2.tar.gz//Decompression Pack
[[email protected] local]# RM-RF cmake-2.8.10.2.tar.gz//Delete compressed package
[Email protected] local]# CD cmake-2.8.10.2
[Email protected] cmake-2.8.10.2]#./configure
[[email protected] cmake-2.8.10.2]# make
[[email protected] cmake-2.8.10.2]# make install
[[Email protected] local]# mv cmake-2.8.10.2 cmake//Modify folder name
Adding environment variables
Add the variable in the file/etc/profile file with VI to make it permanent:
[[email protected] local]# vi/etc/profile//Modify environment variable
Append the following two lines of code to the end of the file:
Path=/usr/local/cmake/bin: $PATH
Export PATH
Then perform the following actions:
[[email protected] local]# source/etc/profile//Make changes effective
Inspection CMake Installation
[Email protected] local]# CMake--version
CMake version 2.8.10.2
3.8 Compiling and installing hadoop2.7.0
TAR-ZXVF hadoop-2.7.0-src.tar.gz-c/usr/hadoop-2.7.0-src/
Cd/hadoop-2.7.0-src
#在编译之前先设置maven内存
Export maven_opts= "-xmx512m-xx:maxpermsize=128m"
#然后编译
MVN Package-pdist,native,docs-dskiptests-dtar
After the compilation is complete, under the/usr/hadoop-2.7.0-src/hadoop-dist/target/directory:
Hadoop-2.7.0.tar.gz is the officially released 32-bit compiled package.
Folder hadoop-2.7.0 is the package after hadoop-2.7.0.tar.gz decompression
Note: The 64-bit official does not publish the compiled package, and the production environment is all 64-bit machines, with 64-bit, so it must be published since it was compiled.
Linux compiled Hadoop source first use