1. Visit the Hadoop website to download hadoop-2.7.1-src.tar.gz
TAR-ZXVF HADOOP-2.7.1-SRC.TAR.GZCD HADOOP-2.7.1-SRCVI BUILDING.txt
requirements:* unix system* jdk 1.7+* maven 3.0 or later* findbugs 1.3.9 (if running findbugs) * protocolbuffer 2.5.0* cmake 2.6 or newer (If compiling native code), must be 3.0 or newer on mac* zlib devel (If compiling native code) * openssl devel ( if compiling native hadoop-pipes and to get the best HDFS encryption performance ) * jansson c xml parsing library ( if compiling libwebhdfs ) * linux fuse (filesystem in userspace) version 2.6 or above ( if compiling fuse_dfs ) * Internet connection for first build (To fetch all maven and hadoop dependencies)
2. Installing java1.8.0_60
Download jdk-8u60-linux-x64.tar.gz, unzip and move to/opt directory
TAR-ZXVF JDK-8U60-LINUX-X64.TAR.GZMV jdk1.8.0_60/opt
Then open the/etc/profile configuration JDK environment variable
Vim/etc/profile
Press I to enter insert mode and add at the end of the file
Export Java_home=/opt/jdk1.8.0_60export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/tools.jarexport PATH = $PATH: $JAVA _home/binexport jre_home=/opt/jdk1.8.0_60/jreexport path= $PATH: $JRE _home/bin
Press ESC successively, shift+:, Wq, enter to save and exit the edit. <br> Enter Source/etc/profile carriage return to save your changes.
Run Javac-version View Status:
[[email protected] opt]# Java-versionjava version "1.8.0_60" Java (TM) SE Runtime Environment (build 1.8.0_60-b27) Java Hots Pot (TM) 64-bit Server VM (build 25.60-b23, Mixed mode)
3. Install the relevant class library
Yum-y Install svn ncurses-devel gcc*yum-y install lzo-devel zlib-devel autoconf automake libtool cmake openssl-devel
4. Install protobuf-2.5.0.tar.gz (Note that the version must be 2.5.0)
Download protobuf-2.5.0.tar.gz
Tar zxvf protobuf-2.5.0.tar.gz
Go to protobuf-2.5.0 and execute it sequentially
CD Protobuf-2.5.0./configuremakemake Install
Verifying that the installation is complete
[Email protected] protobuf-2.5.0]# Protoc--versionlibprotoc 2.5.0
5. Install maven
Download apache-maven-3.2.2-bin.tar.gz
TAR-ZXVF APACHE-MAVEN-3.2.2-BIN.TAR.GZMV apache-maven-3.2.2/opt
To configure environment variables:
Vi/etc/profile
Append at end of file
Export Maven_home=/opt/apache-maven-3.2.2export maven_opts= "-xms256m-xmx512m" Export path= $PATH: $MAVEN _home/bin
Make/etc/profile effective
Source/etc/profile
View installation Status
Mvn-version[[email protected] ~]# mvn-versionapache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17t21:51:42+08:00) Maven Home:/opt/apache-maven-3.2.2java version:1.8.0_60, Vendor:oracle CorporationJava Home:/opt/jdk1.8.0_60/jredefault LOCALE:ZH_CN, Platform Encoding:gb18030os name: "Linux", Version: "3.10.0-229.14.1." El7.x86_64 ", Arch:" AMD64 ", Family:" Unix "
6. Install Ant
Download apache-ant-1.9.4-bin.tar.gz after decompression
TAR-ZXVF apache-ant-1.9.4-bin.tar.gz
Move to the/OPT directory
MV Apache-ant-1.9.4/opt
Configuring Environment variables
Vi/etc/profile
Append at end of file
Export Ant_home=/opt/apache-ant-1.9.4export path= $PATH: $ANT _home/bin
Make changes take effect
Source/etc/profile
View installation Results
[[email protected] ~]# ant-versionapache ant (TM) version 1.9.4 compiled on April 29 2014
7. Installing FindBugs
Download findbugs-3.0.1.tar.gz Unzip
TAR-ZXVF findbugs-3.0.1.tar.gz
Move to the/OPT directory
MV Findbugs-3.0.1/opt
Configuring Environment variables
[Email protected] ~]# vi/etc/profileexport findbugs_home=/opt/findbugs-3.0.1export path= $PATH: $FINDBUGS _home/bin
Make changes take effect
[Email protected] ~]# Source/etc/profile
View installation Results
[Email protected] ~]# findbugs-version3.0.1
8. Compiling HADOOP-2.7.1-SRC
[[Email protected] ~]# CD Hadoop-2.7.1-src[[email protected] hadoop-2.7.1-src]# mvn clean package-pdist,native-dskiptes Ts-dtar
Hadoop2.7.1 stand-alone installation tutorial