Ambari【部署 01】最新版本ambari-2

在结束之际,我想重申的是,学习并非如攀登险峻高峰,而是如滴水穿石般的持久累积。尤其当我们步入工作岗位之后,持之以恒的学习变得愈发不易,如同在茫茫大海中独自划舟,稍有松懈便可能被巨浪吞噬。然而,对于我们程序员而言,学习是生存之本,是我们在激烈市场竞争中立于不败之地的关键。一旦停止学习,我们便如同逆水行舟,不进则退,终将被时代的洪流所淘汰。因此,不断汲取新知识,不仅是对自己的提升,更是对自己的一份珍贵投资。让我们不断磨砺自己,与时代共同进步,书写属于我们的辉煌篇章。

需要完整版PDF学习资源

需要体系化学习资料的朋友,可以加我V获取:vip204888 (备注网络安全)

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化资料的朋友,可以点击这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

Ambari 官网 本次安装的为当前最新版本 2.7.7 文档

1.环境及准备

1.1 环境
# 系统
[root@tcloud ~]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
# JDK
[root@tcloud ~]# java -version
java version "1.8.0\_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
# Python
[root@tcloud ~]# python -V
Python 2.7.5

1.2 准备

Note: You need to have tools such as rpm-build tool, brunch, etc. For details on prerequisites, please see Ambari Development.

在这里插入图片描述

  • 安装maven用于构建项目【已从国内镜像下载安装包】
# 1.解压并移动文件
tar -zxvf apache-maven-3.9.1-bin.tar.gz
mv ./apache-maven-3.9.1/ /usr/local/maven

# 2.配置环境变量
cat <<'EOF' > /etc/profile.d/maven.sh
export MAVEN\_HOME=/usr/local/maven
export PATH=$PATH:$MAVEN\_HOME/bin:$PATH
EOF
# 使配置生效
source /etc/profile.d/maven.sh

# 3.验证安装
mvn -v
# 验证信息
Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
Maven home: /usr/local/maven
Java version: 1.8.0_241, vendor: Oracle Corporation, runtime: /usr/local/java/jdk1.8.0_241/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.71.1.el7.x86\_64", arch: "amd64", family: "unix"

  • 安装rpmbuild
yum install -y rpm-build

  • 在线安装git
yum install -y git

  • 安装nodejs
yum install -y nodejs

  • 安装npm
yum install -y npm

# 修改npm的地址为国内淘宝镜像
npm config set registry https://registry.npm.taobao.org

  • 安装g++
yum install -y gcc-c++

2.下载安装配置启动

安装步骤保留英文原文,部分步骤添加中文解释。

Step 1: Download and build Ambari 2.7.7 source
# 1.官网指导下载方式
wget https://www-eu.apache.org/dist/ambari/ambari-2.7.7/apache-ambari-2.7.7-src.tar.gz
# 实际在清华大学开源软件镜像站下载
https://mirrors.tuna.tsinghua.edu.cn/

# 2.解压
tar -zxvf apache-ambari-2.7.7-src.tar.gz
# 切换文件夹
cd apache-ambari-2.7.7-src

在这里插入图片描述

# 3.设置新的版本号并构建项目【云服务器用时10分钟多】
mvn versions:set -DnewVersion=2.7.7.0.0

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

# 4.切换到 ambari-metrics 目录下
pushd ambari-metrics
# 构建 ambari-metrics【云服务器用时不到2分钟】
mvn versions:set -DnewVersion=2.7.7.0.0
# 切换到原文件夹
popd

在这里插入图片描述
在这里插入图片描述

# 5.maven 打包项目【云服务器用时】一定要注意执行命令的文件夹
# Re-run Maven using the -X switch to enable full debug logging.
mvn -B clean install rpm:rpm -DnewVersion=2.7.7.0.0 -DbuildNumber=388e072381e71c7755673b7743531c03a4d61be8 -DskipTests -Dpython.ver="python >= 2.6" -X

-Drat.skip=true -Preplaceurl

在这里插入图片描述

打包项目时的问题
  • 无法下载文件【从GIT下载失败 原因就不多说了】
# 报错详情
[INFO] Downloading https://github.com/yarnpkg/yarn/releases/download/v0.23.2/yarn-v0.23.2.tar.gz to /root/.m2/repository/com/github/eirslett/yarn/0.23.2/yarn-0.23.2./yarn-v0.23.2.tar.gz

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.4:install-node-and-yarn (install node and yarn) on project ambari-web: Could not download Yarn: Could not download https://github.com/yarnpkg/yarn/releases/download/v0.23.2/yarn-v0.23.2.tar.gz: Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1]

# 问题解决
# 1.自行下载安装包【浏览器直接输入文件地址即可】
https://github.com/yarnpkg/yarn/releases/download/v0.23.2/yarn-v0.23.2.tar.gz

# 2.放到对应 maven 目录中
/root/.m2/repository/com/github/eirslett/yarn/0.23.2/yarn-0.23.2./yarn-v0.23.2.tar.gz

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 没有许可证字段
# 报错详情
[ERROR] warning Ambari@2.4.0: No license field
[INFO] [1/4] Resolving packages...
[INFO] [2/4] Fetching packages...
[ERROR] warning fsevents@0.3.8: The platform "linux" is incompatible with this module.
[ERROR] warning fsevents@1.1.1: The platform "linux" is incompatible with this module.
[INFO] info "fsevents@0.3.8" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [3/4] Linking dependencies...
[INFO] [4/4] Building fresh packages...

# 问题解决
# 无需处理耐心等待后续报错

  • 命令执行失败【未解决】
# 报错详情
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (Bower install) on project ambari-admin: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

# 问题解决
# 编辑 .bowerrc 文件
cd ambari-admin/src/main/resources/ui/admin-web
vim .bowerrc
# 修改后
{
    # 原始
    "directory": "app/bower\_components"
    # 新增
    ,"allow\_root": true
}

# 删除admin-web下的node及node\_modules文件夹文件
rm -rf node*
# 清除仓库最后更新文件
find ~/.m2/repository/ -name "\*.lastUpdated" -exec rm -rf {} \;

在这里插入图片描述

  • 无法访问git仓库:遇到文件结束【未解决】
# 报错详情
fatal: unable to access 'https://github.com/mochajs/mocha.git/': Encountered end of file

# 关闭代理
git config --global --unset http.proxy
git config --global --unset https.proxy

  • 服务器空回复【未解决】
# 报错详情
bower angular-translate#\* 
ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/PascalPrecht/bower-angular-translate.git", exit code of #128 fatal: unable to access 'https://github.com/PascalPrecht/bower-angular-translate.git/': Empty reply from server


**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**需要体系化学习资料的朋友,可以加我V获取:vip204888 (备注网络安全)**

**[需要这份系统化资料的朋友,可以点击这里获取](https://bbs.csdn.net/topics/618540462)**

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

  • 15
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值