您的位置:首页 > 运维架构

hadoop源码编译错误

2011-09-23 19:18 344 查看
我在源码根目录下执行:

mvn test -DskipTests

结果报错:

[INFO] Apache Hadoop Project POM ......................... SUCCESS [8.472s]

[INFO] Apache Hadoop Annotations ......................... SUCCESS [2:40.737s]

[INFO] Apache Hadoop Project Dist POM .................... SUCCESS [1.344s]

[INFO] Apache Hadoop Assemblies .......................... SUCCESS [0.200s]

[INFO] Apache Hadoop Auth ................................ SUCCESS [0.665s]

[INFO] Apache Hadoop Auth Examples ....................... SUCCESS [2:07.623s]

[INFO] Apache Hadoop Common .............................. SUCCESS [11.703s]

[INFO] Apache Hadoop Common Project ...................... SUCCESS [0.003s]

[INFO] Apache Hadoop HDFS ................................ SUCCESS [17.043s]

[INFO] Apache Hadoop HDFS Project ........................ SUCCESS [0.003s]

[INFO] hadoop-yarn-api ................................... FAILURE [0.618s]

[INFO] hadoop-yarn-common ................................ SKIPPED

[INFO] hadoop-yarn-server-common ......................... SKIPPED

[INFO] hadoop-yarn-server-nodemanager .................... SKIPPED

[INFO] hadoop-yarn-server-resourcemanager ................ SKIPPED

[INFO] hadoop-yarn-server-tests .......................... SKIPPED

[INFO] hadoop-yarn-server ................................ SKIPPED

[INFO] hadoop-yarn ....................................... SKIPPED

[INFO] hadoop-mapreduce-client-core ...................... SKIPPED

[INFO] hadoop-mapreduce-client-common .................... SKIPPED

[INFO] hadoop-mapreduce-client-shuffle ................... SKIPPED

[INFO] hadoop-mapreduce-client-app ....................... SKIPPED

[INFO] hadoop-mapreduce-client-hs ........................ SKIPPED

[INFO] hadoop-mapreduce-client-jobclient ................. SKIPPED

[INFO] hadoop-mapreduce-client ........................... SKIPPED

[INFO] hadoop-mapreduce .................................. SKIPPED

[INFO] Apache Hadoop Main ................................ SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 5:29.238s

[INFO] Finished at: Fri Sep 23 19:16:45 CST 2011

[INFO] Final Memory: 30M/197M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (generate-sources) on project hadoop-yarn-api: Command execution failed. Process exited with an error: 1(Exit value: 1) -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :hadoop-yarn-api

解决办法:

YARN (YET ANOTHER RESOURCE NEGOTIATOR or YARN Application Resource Negotiator)
------------------------------------------------------------------------------

Requirements
-------------
Java: JDK 1.6
Maven: Maven 3

Setup
-----
Install protobuf 2.4.0a or higher (Download from http://code.google.com/p/protobuf/downloads/list) - install the protoc executable (configure, make, make install)
- install the maven artifact (cd java; mvn install)
Installing protoc requires gcc 4.1.x or higher.
If the make step fails with (Valid until a fix is released for protobuf 2.4.0a)
./google/protobuf/descriptor.h:1152: error:
`google::protobuf::internal::Mutex*google::protobuf::DescriptorPool::mutex_'
is private
Replace descriptor.cc with http://protobuf.googlecode.com/svn-history/r380/trunk/src/google/protobuf/descriptor.cc 
Quick Maven Tips
----------------
clean workspace: mvn clean
compile and test: mvn install
skip tests: mvn install -DskipTests
skip test execution but compile: mvn install -Dmaven.test.skip.exec=true
skip native build: mvn -fn install -P-cbuild
clean and test: mvn clean install
run selected test after compile: mvn test -Dtest=TestClassName (combined: mvn clean install -Dtest=TestClassName)
create runnable binaries after install: mvn assembly:assembly (combined: mvn clean install assembly:assembly)

Eclipse Projects
---------------- http://maven.apache.org/guides/mini/guide-ide-eclipse.html 
1. Generate .project and .classpath files in all maven modules
mvn eclipse:eclipse
CAUTION: If the project structure has changed from your previous workspace, clean up all .project and .classpath files recursively. Then run:
mvn eclipse:eclipse

2. Import the projects in eclipse.

3. Set the environment variable M2_REPO to point to your .m2/repository location.

NetBeans Projects
-----------------

NetBeans has builtin support of maven projects. Just "Open Project..."
and everything is setup automatically. Verified with NetBeans 6.9.1.

Custom Hadoop Dependencies
--------------------------

By default Hadoop dependencies are specified in the top-level pom.xml
properties section. One can override them via -Dhadoop-common.version=...
on the command line. ~/.m2/settings.xml can also be used to specify
these properties in different profiles, which is useful for IDEs.

Modules
-------
YARN consists of multiple modules. The modules are listed below as per the directory structure:

hadoop-yarn-api - Yarn's cross platform external interface

hadoop-yarn-common - Utilities which can be used by yarn clients and server

hadoop-yarn-server - Implementation of the hadoop-yarn-api
hadoop-yarn-server-common - APIs shared between resourcemanager and nodemanager
hadoop-yarn-server-nodemanager (TaskTracker replacement)
hadoop-yarn-server-resourcemanager (JobTracker replacement)

Utilities for understanding the code
------------------------------------
Almost all of the yarn components as well as the mapreduce framework use
state-machines for all the data objects. To understand those central pieces of
the code, a visual representation of the state-machines helps much. You can first
convert the state-machines into graphviz(.gv) format by
running:
mvn compile -Pvisualize
Then you can use the dot program for generating directed graphs and convert the above
.gv files to images. The graphviz package has the needed dot program and related
utilites.For e.g., to generate png files you can run:
dot -Tpng NodeManager.gv > NodeManager.png
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息