编译安装Ambari2.5.0
来源:互联网 发布:局域网桌面监控软件 编辑:程序博客网 时间:2024/06/04 20:27
1.需要安装的工具
1.1 安装JDK 推荐1.8
1.2 安装Apache Maven 3.3.9
设置环境变量
# vi /etc/profile
export MAVEN_HOME="/opt/maven"
export path=$path: $MAVEN_HOME/bin
1.3 安装rpmbuild
1)检测rpm-build是否已经安装
[root@bigData-02 ~]# rpm -qa | grep rpm-build
2)安装
[root@bigData-02 ~]# yum install rpm-build
1.4 安装g++
- 检测
[root@bigData-02 ~]# rpm -qa | grep gcc-c++
- 安装
[root@bigData-02 ~]# yum install gcc-c++
1.5 安装NodeJS
- 下载
[root@bigData-02 ~]# wget http://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.gz
- 解压
[root@bigData-02 ~]# tar –zxvf node-v6.10.3-linux-x64.tar.gz
- 设置环境变量
[root@bigData-02 ~]# vi /etc/profile
export NODE_HOME="/opt/node"
export path=$path: $NODE_HOME/bin
[root@bigData-02 ~]#source /etc/profile
- 检测是否正确安装
[root@bigData-02 ~]# node -v
v0.10.33
[root@bigData-02 ~]# npm -v
1.4.28
1.6 安装Brunch
1)安装
[root@bigData-02 ~]# npm install -g brunch
- 检测
[root@bigData-02 ~]# brunch
Usage: brunch [command] [options]
Commands:
new [skeleton] [path] Create new brunch project in path [.]. Short-cut: n
build [options] Build a brunch project. Short-cut: b
watch [options] Watch brunch directory and rebuild if something changed. Short-cut: w
Options:
-h, --help output usage information
-V, --version output the version number
1.7 安装git
- 检测
[root@bigData-02 ~]# Git –version
- 安装
[root@bigData-02 ~]# yum install git
2 编译Ambari
2.1 下载
在官网下载最新版本2.5.0
解压之后上传到linux服务器上。
2.2 编译
进入到ambari的主目录中,执行mvn编译命令。
- 给ambari打上版本号
[root@bigData-02 ~]#
mvn versions:set -DnewVersion=
2.5
.
0.0
.
0
pushd ambari-metrics
mvn versions:set -DnewVersion=
2.5
.
0.0
.
0
popd
- 编译ambari
[root@bigData-02 ambari]#
mvn -B clean install
package
rpm:rpm -DnewVersion=
2.5
.
0.0
.
0
-DskipTests -Dpython.ver=
"python >= 2.6"
自此编译成功。
编译技巧:
1)需要注意的是此处maven编译大约要下载258M左右的依赖,在网络不好的情况下经常会出现time out的异常,并且需要反复编译,特别耗时,第一次编译大概花了一天时间,因此编译的时候可以对project进行逐个编译,节约时间。
2)项目中需要使用nodejs中的npm管理依赖,有些依赖特别难下载,下载好之后会存放在ambari-web/node_modules中,在下次编译的时候可以对ambari-web/node_modules备份,下次编译的时候,可以先对项目进行mvn clean删除,然后再将备份的node_modules拷入项目中,重新执行mvn install操作,可以节省很多时间。
psutils-compile错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (psutils-compile) on project ambari-metrics-host-monitoring: An Ant BuildException has occured: exec returned:1[ERROR] around Ant part ...<exec failonerror="true" dir="/root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil" executable="/root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/unix/ambari-python-wrap">... @ 4:275in /root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/target/antrun/build-psutils-compile.xml[ERROR] -> [Help 1]根据该错误信息,打开xml文件:
<?xml version="1.0" encoding="UTF-8" ?><project name="maven-antrun-" default="psutils-compile" ><target name="psutils-compile"> <exec failonerror="true" dir="/root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil" executable="/root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/unix/ambari-python-wrap"> <arg value="setup.py"/> <arg value="build"/> <arg value="--build-platlib"/> <arg value="/root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/target/psutil_build"/> </exec></target></project>
带上参数执行了一下wrap:
[root@bluejoe0 apache-ambari-2.5.0-src]# /root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/uniython-wrap setup.py build --build-platlib /root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/target/psutil_build/usr/bin/python2: can't open file 'setup.py': [Errno 2] No such file or directory[root@bluejoe0 apache-ambari-2.5.0-src]# cd /root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil[root@bluejoe0 psutil]# /root/apache-ambari-2.4.2-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/unix/ambari-python-wrap setup.py build --build-platlib /root/apache-ambari-2.5.0-src/ambari-metrics/ambari-metrics-host-monitoring/target/psutil_buildrunning buildrunning build_pyrunning build_extbuilding '_psutil_linux' extensiongcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.6 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.6/psutil/_psutil_linux.opsutil/_psutil_linux.c:12:20: error: Python.h: No such file or directoryIn file included from psutil/_psutil_linux.c:23:psutil/_psutil_linux.h:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ tokenpsutil/_psutil_linux.h:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ tokenpsutil/_psutil_linux.h:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ tokenpsutil/_psutil_linux.h:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ tokenpsutil/_psutil_linux.h:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ tokenpsutil/_psutil_linux.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ tokenpsutil/_psutil_linux.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ tokenpsutil/_psutil_linux.c: In function ‘ioprio_get’:psutil/_psutil_linux.c:50: warning: implicit declaration of function ‘syscall’
类似这样的错误,在网上查了一下,告知需要安装Python-devel版本,因此:
yuminstall python-devel
遇到没有安装setuptools的话,运行下面的语句。
yum install python-pip
2.3 安装RPM包
Ambari安装需要ambari-server安装到管理机上,ambari-agent安装到集群节点上。
Ambari-server的rpm包
ambari-server/target/rpm/ambari-server/RPMS/noarch/ambari-server-*.noarch.rpm
Ambari-agent的rpm包
ambari-agent/target/rpm/ambari-agent/RPMS/x86_64/ambari-agent-*.rpm
操作指南,请查阅:
https://www.ibm.com/developerworks/cn/opensource/os-cn-bigdata-ambari/index.html
- 编译安装Ambari2.5.0
- Ambari2.4 源码编译
- ubuntu14安装ambari2.2
- Ambari2.5.0与HDP2.6.0集群安装配置
- Ambari2.1安装hdp2.3
- Ambari2.1安装HDP2.3
- Ambari2.1安装hdp2.3
- Redhat6.6安装Ambari2.0.1
- centos7(vm)下安装Ambari2.4.0(x86)
- Ambari2.2.2安装部署(Centos7.2)
- Ambari学习15_CentOS6.5下安装Ambari2.4全过程
- ambari2.1离线安装HDP2.1实践教程
- 大数据平台安装部署文档 Ambari2.4-HDP2.5
- Centos7.3安装Ambari2.4.2+HDP2.5.3搭建Hadoop集群
- centos6.7下安装ambari2.2.2出现的几种问题
- Ambari2.0.0汉化
- Ambari2.4build问题
- Ambari2.5.3卸载smartsense
- Code::Blocks导出MakeFile文件工具
- C# DataGridView运用
- Others4_京东联盟(京享街)与京东购物返利
- Android自定义View学习之圆角图片(圆形图片)
- 排序算法总结(9)--基数排序
- 编译安装Ambari2.5.0
- LeetCode 258. Add Digits (int转string)
- 读取字节太多导致STM32读取TF错误
- 不输入密码ssh直接登录Linux主机的实践与总结
- top-1 recall precise解释
- HDU2571(dp)
- C++ using namespace std 详解 与 命名空间的使用
- 290. Word Pattern
- JAVA冒泡排序衍生求最大最小值