1. Install the dependent packages:
Yum Install GCC pkg-config Libssl-dev
2. Install Protobuf 2.5.0,
First go to Google's website to download Protobuf source code, unzip and switch to the root user to execute the following command:
./configure
If an error occurs in the middle, it indicates that some of the packages are dependent and installed.
An error occured because dependency isn't metthe error is cleaned
Once the required dependencies have been installed, execute:
./make. /makeinstall
3. Compiling Hadoop source code
First download the hadoop-2.2.0 source code, unzip.
2.1. Switch to the source code directory and execute:
Install -dhttp.proxyhost=proxy01.cd.intel.com-dhttp.proxyport=911
The yellow part acts as the setting agent. Because my compilation environment in the company intranet, so need to set up proxy
The following error was found:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1: Testcompile (Default-testcompile) on Project hadoop-auth:compilation failure:compilation Failure:[error]/home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/ authenticatortestcase.java:[ the, One] Error:cannot access Abstractlifecycle[error] classfile fororg.mortbay.component.AbstractLifeCycle not Found[error]/home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/ authenticatortestcase.java:[ the, in] Error:cannot access Lifecycle[error] classfile fororg.mortbay.component.LifeCycle not Found[error]/home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/ authenticatortestcase.java:[98,Ten] Error:cannotFindSymbol[error] Symbol:method start () [ERROR] location:variable server of type Server[error]/home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/ authenticatortestcase.java:[104, A] Error:cannotFindSymbol[error]--[Help1]
Need to modify the hadoop-common-project/hadoop-auth/pom.xml below the source code, the yellow part is new
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<scope>test</scope>
</dependency>
<dependency> <groupId>org.mortbay.jetty</groupId> <artifactid>jetty-util</ artifactid> <scope>test</scope> </dependency>
Re-execute, smooth through
2.2. Build the Eclipse Project environment:
MVN eclipse:eclipse-dskiptests -dhttp.proxyhost=proxy01.cd.intel.com-dhttp.proxyport=911
2.3. Open Eclipse and import the project under the source code directory.