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

hadoop-2.2.0源码编译

2014-04-24 12:50 435 查看
编译hadoop-2.2.0 
下载hadoop-2.2.0-src包,解压 
安装好maven2 
执行 
mvn clean install -DskipTests 
运行报错: 
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.2.0:protoc
(compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException:
protoc version is 'libprotoc 2.4.1', expected version is '2.5.0' -> [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-common 

安装protoc 
wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz  (此处下载https://code.google.com/p/protobuf/downloads/list) 
解压执行 sudo ./configure --prefix=/usr 
若安装报错: 
cpp: error trying to exec 'cc1plus': execvp: No such file or directory 

则安装g++ 
sudo apt-get install g++ 

执行 
sudo make 
sudo make check 
sudo make install 
protoc --version 
遇到protoc: error while loading shared libraries: libprotoc.so.8: cannot open shared object file: No such file or directory 
时 
ubuntu系统,默认安装在/usr/local/lib下,需要指定/usr。sudo
./configure --prefix=/usr 必须加上--proix参数,重新编译和安装。 

查看BUILDING.txt eclipse部分 

Importing projects to eclipse 

When you import the project to eclipse, install hadoop-maven-plugins at first. 

  $ cd hadoop-maven-plugins 
  $ mvn install 

Then, generate eclipse project files. 

  $ mvn eclipse:eclipse -DskipTests 

At last, import to eclipse by specifying the root directory
of the project via 
[File] > [Import] > [Existing Projects into Workspace].
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  eclipse hadoop