Tez 0.7和0.8编译
在tez编译过程中会遇到各种各样的问题,如果你是编译0.5的,因为0.5中没有tez-ui所以编译过程中基本没有什么问题,
先准备环境
1、linux 环境,我的是centos6.4 32位的
2、可编译的maven环境 我这边用得maven3.3.9的环境
3、protoc的版本是2.5.0
4、需要安装nodejs npm bower git
protoc版本
[root@localhost
bin]# protoc --version
libprotoc 2.5.0
maven版本:
[root@localhost
bin]# mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /root/app/apache-maven-3.3.9
Java version: 1.7.0_75, vendor: Oracle Corporation
Java home: /usr/bin/jdk1.7.0_75/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-358.el6.i686", arch: "i386", family: "unix"
安装nodejs
# yum -y install gcc make gcc-c++ openssl
# wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
# tar -zxvf node-v0.10.26.tar.gz
# make && make install
# node -v v0.10.26
在安装完成nodejs以后就可以用下面命令安装npm
安装npm
curl -L https://www.npmjs.com/install.sh
| sh
如果执行node -v和npm -v能看到版本就说明安装成功了
[root@localhost
~]# node -v
v0.10.26
[root@localhost
~]# npm -v
3.8.3
安装bower
npm -g install bower
执行下面命令如果提示了如下命令说明bower安装成功。中这个错误提示的是root用户不能执行bower install 命令
如果需要安装 需要加 --allow-root命令
[root@localhost
bin]# bower install
bower ESUDO Cannot be run with sudo
Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.
http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814
You can however run a command with sudo using --allow-root option
安装git
我是用yum安装 但是git的版本比较老了,所以我们在安装git之前需要更新yum
1、首先更新yum
sudo yum update
2、安装依赖的包
sudo
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
3、下载git源码并解压缩
wget https://github.com/git/git/archive/v2.3.0.zip
unzip v2.3.0.zip
cd git-2.3.0
4、编译安装
将其安装在“/usr/local/git”目录下。
make prefix=/usr/local/git all
sudo make prefix=/usr/local/git install
5、修改 /etc/profile文件
将PATH中增加 /usr/local/git/bin 这个路径 ,并且生效 source /etc/profile
如果执行 git --version能查看到版本号说明已经安装成功了
[root@localhost
tez-ui]# git --version
git version 2.3.0
以上的maven protoc nodeje npm bower git是需要安装的软件。
修改pom.xml文件,在tez-ui目录下面有一个pom.xml文件,我们需要对其进行修改,因为如果是root用户编译的时候
执行bower install会出错,所以我们需要在中间加一个参数 --allow-root
node_modules/bower/bin/bower
install
--allow-root
--remove-unnecessary-resolutions=false
编译的命令 mvn clean package -DskipTests=true -Dmaven.javadoc.skip=true
编译成功的包会放在tez-dist/target 目录下面