hadoop2.7.7 在 ubuntu 的源码编译

问题 1

[ERROR] Failed to execute goal 
org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc 
(compile-protoc) on project hadoop-common: 
org.apache.maven.plugin.MojoExecutionException: 
protoc version is 'libprotoc 2.6.1', 
expected version is '2.5.0' -> [Help 1]
[ERROR]

protobuf 版本不正确,改写正确版本

操作方式

下载

wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2

解压

tar xfvj protobuf-2.5.0.tar.bz2

编译安装

cd protobuf-2.5.0
./configure
make -j 4
make install

最后将 2.5.0 版本正确链接到你调用的 protobuf

问题 2

编译报错

[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.7.7:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: protoc failure -> [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

用该命令打包出 output 文件

mvn package -Pdist,native -DskipTests -Dtar

问题 3

报错

hadoop-common: Error running javah command: Error executing command line. Exit code:2

没有找到 javah

需要在环境变量中配置 JAVA_HOME=/root/jdk

问题 4

java_home 最好是下载一个 jdk,以其作为 java_home

问题 5

ubuntu 环境,可能遇到 openssl 没有

apt-get install libssl1.0-dev
apt-get install libssl1.0

问题 6

when the compile is compelted
the target files lies on /root/hadoop-2.7.7-src/hadoop-dist/target/hadoop-2.7.7

  
    展开阅读全文