Apache Tez0.7编译笔记





目前最新的Tez版本是0.8,但还不是稳定版,所以大家还是先下载0.7用吧
下载地址: wget http://archive.apache.org/dist/tez/0.7.0/apache-tez-0.7.0-src.tar.gz


由于编译Tez-UI模块,需要使用nodejs,所以建议还是
提前安装nodejs 和npm工具,安装方式,可以下载源码安装
也可以yum安装,安装步骤:

(1)安装nodejs镜像
sudo curl --silent --location https://rpm.nodesource.com/setup | sudo bash -
(2)yum安装nodejs,前提是你已经安装了
yum -y install gcc-c++ make
yum -y install nodejs

(3)查看版本:
node -v
npm -v
没有问题即可

(4)解压tez到某个目录,然后进入根目录,修改pom.xml文件:
升级frontend版本为0.0.23

<plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>0.0.23</version>
        </plugin>


进入tez ui的模块下,修改pom.xml文件,在
grunt build 和 Bower install下面的configuration下面增加下面一个段配置,允许以root权限执行构建

<arguments>
                <argument>node_modules/bower/bin/bower</argument>
                <argument>install</argument>
                <argument> --allow-root</argument>
                <argument>--remove-unnecessary-resolutions=false</argument>
</arguments>


然后执行命令:mkdir -p  apache-tez-0.7.0-src/tez-ui/src/main/webapp/dist创建一个
dist目录,否则最后,会报一个dist目录不存在的错误,导致编译失败

另外需要注意的是,在tez-ui编译的时候,需要大量下载npm nodejs相关的包,如果没有下载可以执行
npm install xxx 进行下载安装,
除以之外还有一个错误,就是有些依赖模块,会报一个 error use strict model 异常,导致tez-ui无法正常
编译通过,解决办法,下载低版本的依赖包,即可,目前发现两个依赖出现此种问题:

解决办法:先卸载原来版本的,然后重新安装低版本,如果提示权限不够,就在命令前面加上sudo
npm uninstall qs
npm uninstall hawk
npm install [email protected]
npm  install [email protected]

博客地址:http://qindongliang.iteye.com/

最后看以下,编译过程中,nodejs依赖的所有包:
执行命令:ll node_modules/ | gawk '{print $9}'

abbrev
ansicolors
ansi-regex
ansistyles
aproba
archy
argparse
asn1
assert-plus
async
async-some
aws-sign2
balanced-match
bl
boom
brace-expansion
buffers
caseless
chainsaw
chownr
cli-color
cmd-shim
columnify
combined-stream
concat-map
config-chain
core-util-is
cryptiles
dashdash
debuglog
delayed-stream
dezalgo
ecc-jsbn
editor
end-of-stream
esprima
extsprintf
forever-agent
form-data
fstream
fstream-npm
fs-vacuum
fs-write-stream-atomic
glob
graceful-fs
has-unicode
hawk
hoek
hosted-git-info
http-signature
iferr
imurmurhash
inflight
inherits
ini
init-package-json
isarray
jodid25519
jsbn
json-schema
json-stringify-safe
jsprim
js-yaml
lockfile
lodash
lodash._baseindexof
lodash._baseuniq
lodash._bindcallback
lodash._cacheindexof
lodash.clonedeep
lodash._createcache
lodash._getnative
lodash.isarguments
lodash.isarray
lodash.isfunction
lodash.isobject
lodash.keys
lodash.now
lodash.restparam
lodash.union
lodash.uniq
lodash.without
mime-db
mime-types
minimist
mkdirp
mute-stream
node-gyp
node-uuid
nopt
normalize-git-url
normalize-package-data
npm-cache-filename
npm-install-checks
npmlog
npm-package-arg
npm-registry-client
npm-user-validate
oauth-sign
once
opener
osenv
osx-release
path-is-inside
process-nextick-args
qs
read
readable-stream
read-cmd-shim
readdir-scoped-modules
read-installed
readline2
read-package-json
read-package-tree
realize-package-specifier
request
retry
rimraf
rx
semver
sha
sigmund
slide
sntp
sorted-object
sprintf-js
sshpk
string_decoder
stringstream
strip-ansi
tar
text-table
through
tough-cookie
traverse
tunnel-agent
tweetnacl
uid-number
umask
unique-filename
unpipe
user-home
util-deprecate
uuid
validate-npm-package-license
validate-npm-package-name
verror
which
win-release
wordwrap
wrappy
write-file-atomic
xdg-basedir
xtend



(5)最后在tez根目录下输入如下命令进行构建:
mvn clean package -DskipTests=true -Dmaven.javadoc.skip=true
大概10多分钟即可编译成功:





成功后,在tez的根目录下创建tezlib文件夹:
执行输入命令,拷贝所有tez相关的jar到tezlib下面:
find . -name "*jar" -print | cp -a `xargs` tezlib/



扫码关注微信公众号:我是攻城师(woshigcs),我们一起学习,进步和交流!(woshigcs)
本公众号的内容是有关搜索和大数据技术和互联网等方面内容的分享,也是一个温馨的技术互动交流的小家园,有什么问题随时都可以留言,欢迎大家来访!

猜你喜欢

转载自qindongliang.iteye.com/blog/2271440