最近准备学习使用Tez,因此从官网下载了最新的Tez 0.8.3源码,按照安装教程编译使用。平时使用的集群环境是离线的,本打算这一次也进行离线编译,无奈一编译就开始报缺少jar包的错,即使手动下载jar包复制到目录、尝试使用Maven的包安装命令,还是无法消除错误。只得尝试在联网环境下先进行编译(环境与离线集群环境相同),再看编译得到的jar包是否可以在Hadoop离线集群上正常使用了。

  之前从没接触过Maven,网上资料也多是和Eclipse放在一起,作为Eclipse的一个插件来说明的。时间紧张,这次编译过程中我也没有花特别多时间去研究Maven原理和复杂操作,一切遇到的报错,都以编译成功Tez为首要目标,所幸编译过程中遇到的几个问题都是网络传输问题,稍微了解了下pom.xml文件的作用,读懂报错信息多做尝试就解决了。本文主要记录编译过程中的报错和尝试并最终成功解决的方法,以作备案,对错误的原因和解决背后原理不做深究。

 

编译环境:

CentOS  6.5, Maven 3.0.5, protobuf 2.5.0, Apache Tez源码0.8.3

 

 

1. 无法从中央仓库(Central Repository)传输(url)jar包,Return code is: 405 , ReasonPhrase:Not Allowed.”


  报错信息没有保存完整,大致意思就是无法下载某一jar包,并提示了一个错误返回码。最初以为该错误码是Maven的错误码,搜了好久未有所得,后来才发现405是尝试下载Jar包时服务器返回的HTTP错误码,即无法按报错信息中的url下载到jar包。

  需要更改POM文件中的仓库设置,增加新的有效的远程仓库地址,这样即可成功下载jar包并继续编译过程。

  在Tez文件夹下的pom.xml的<repositories> 标签下照已有的标签复制粘贴一组新的<repository>,id和name随便起一下,然后在url处粘新的repository网站地址。
在一篇文章里看到了一个搜mvn组件很有用的网站,可以直接从搜索结果里下载jar包,根据jar包的下载地址一级域名即可得到新的有效的repository地址,该搜索网站为http://search.maven.org/


2. [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.22:install-node-and-npm (install node and npm) on project tez-ui: Could not download Node.js: Got error code 404 from the server.

 

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.22:install-node-and-npm (install node and npm) on project tez-ui: Could not download Node.js: Got error code 404 from the server. -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :tez-ui

 

  无法下载nodejs安装文件,在tez文件夹下运行mvn时,无法得到完整的报错信息。注意到该报错是编译子project tez-ui时的错误,进入tez-ui文件夹,再次执行 mvn clean package -DskipTests=true -Dmaven.javadoc.skip=true

  

  从INFO部分,可以看到是在尝试下载node时发生了错误。复制下载链接在浏览器中打开是可以下载的,但是在虚拟机中的浏览器中尝试下载却返回了404(明明同个文件夹下其他文件都可以正常下载,诡异的很)。该下载链接改为https也可以正常下载,无奈搜索tez-ui文件夹下的文章也没找到node下载链接是哪里设置的,故无法更改下载方式和下载链接。

  转换思路,尝试下载其他版本的node是可以的。尝试更改tez-ui目录下的pom.xml中node的版本,从0.12.2改成0.12.3,回到tez目录下再次执行编译,报错解决。

  tez-ui2也有类似问题,同理需要改tez-ui2文件夹下的pom.xml文件中node的版本,从0.12.2改为0.12.3


3.[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (Bower install) on project tez-ui: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

[DEBUG] Executing command line: [/home/joy/tez/apache-tez-0.8.3-src/tez-ui/src/main/webapp/node/node, node_modules/bower/bin/bower, install, --remove-unnecessary-resolutions=false]
bower FileSaver.js#24b303f49213b905ec9062b708f7cd43d56a5dde ENOGIT git is not installed or not in the PATH
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 41.785s
[INFO] Finished at: Sat Jun 11 05:09:35 PDT 2016
[INFO] Final Memory: 9M/22M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (Bower install) on project tez-ui: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

  根据INFO上一行的最后输出

bower FileSaver.js#24b303f49213b905ec9062b708f7cd43d56a5dde ENOGIT git is not installed or not in the PATH

  是系统中没有安装git,使用yum install git安装git即可

  最终编译成功,现在还没有部署到离线环境看能不能成功运行,找了篇安装博客,如果出现问题之后再记录解决过程。

posted on 2016-06-14 11:34  夕照_Joy  阅读(3069)  评论(0编辑  收藏  举报