hadoop yarn ui2编译问题记录

https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/YarnUI2.html
官方文档对yarn ui2的使用说明比较简单,在yarn-site.xml中修改yarn.webapp.ui2.enable为true即可

但是如果是自己编译的Hadoop,打开http://xxx:8088/ui2页面会报503
排查发现是根本都没有ui2的相关资源文件,需要在编译的时候加上-Pyarn-ui才行

查看hadoop根目录下的BUILDING.txt文件
编译依赖项:

Requirements:

* Unix System
* JDK 1.8
* Maven 3.3 or later
* ProtocolBuffer 2.5.0
* CMake 3.1 or newer (if compiling native code)
* Zlib devel (if compiling native code)
* openssl devel (if compiling native hadoop-pipes and to get the best HDFS encryption performance)
* Linux FUSE (Filesystem in Userspace) version 2.6 or above (if compiling fuse_dfs)
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)
* python (for releasedocs)
* bats (for shell code testing)
* Node.js / bower / Ember-cli (for YARN UI v2 building)

安装yarn ui2是需要依赖Node.js / bower / Ember-cli的:

yum -y install node npm
npm install -g bower
npm install -g ember-cli

通过yum安装node时报错:

/usr/local/openssl/lib/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found

解决方法:

mv /usr/local/openssl/lib/libcrypto.so.1.1 /usr/local/openssl/lib/libcrypto.so.1.1_bak
cp /usr/lib64/libcrypto.so.1.1 /usr/local/openssl/lib/libcrypto.so.1.1

参考:
https://stackoverflow.com/questions/61133615/mysql-usr-local-lib-libssl-so-1-1-version-openssl-1-1-1-not-found-required
https://blog.csdn.net/sunhson/article/details/106476185


编译选项说明:

  * Use -Pnative to compile/bundle native code
  * Use -Pdocs to generate & bundle the documentation in the distribution (using -Pdist)
  * Use -Psrc to create a project source TAR.GZ
  * Use -Dtar to create a TAR with the distribution (using -Pdist)
  * Use -Preleasedocs to include the changelog and release docs (requires Internet connectivity)
  * Use -Pyarn-ui to build YARN UI v2. (Requires Internet connectivity)
  * Use -DskipShade to disable client jar shading to speed up build times (in
    development environments only, not to build release artifacts)
  * Use -Pnative to compile/bundle native code
  * Use -Pdocs to generate & bundle the documentation in the distribution (using -Pdist)
  * Use -Psrc to create a project source TAR.GZ
  * Use -Dtar to create a TAR with the distribution (using -Pdist)
  * Use -Preleasedocs to include the changelog and release docs (requires Internet connectivity)
  * Use -Pyarn-ui to build YARN UI v2. (Requires Internet connectivity)
  * Use -DskipShade to disable client jar shading to speed up build times (in
    development environments only, not to build release artifacts)

这里是我使用的编译选项:
mvn clean package -Pdist -DskipTests -Pdocs -Pyarn-ui

然后安装时bower install报错:

ENOTFOUND Package abdmob/x2js=abdmob/x2js not found

解决方法:
修改hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp目录下的bower.json和ember-cli-build.js文件,把abdmob/x2js改为x2js
参考:https://blog.csdn.net/vah101/article/details/106388231
在hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp目录下直接执行bower install命令能正常安装依赖,就说明是OK的

修改完后为了从刚才失败的地方恢复编译,而不是从头开始编译,在编译命令后加-rf :hadoop-yarn-ui即可

然后还有个问题就是,bower ESUDO Cannot be run with sudo
这是因为用root用户执行bower install导致的
不用root用户编译应该可以解决,不过我这里是通过修改maven pom文件解决
修改hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/pom.xml文件:

<execution>
                <phase>generate-resources</phase>
                <id>bower install</id>
                <configuration>
                  <arguments>install</arguments>
                </configuration>
                <goals>
                  <goal>bower</goal>
                </goals>
</execution>

这里<arguments>install</arguments>改为
<arguments>install --allow-root</arguments

后面发现还有个更简单方案,直接修改bower的配置:
echo ‘{ “allow_root”: true }’ > /root/.bowerrc


编译完之后再修改配置启动,yarn ui2页面可以正常访问


注意如果加了-Pnative,则对cmake版本有要求:

yum update
yum install libc6-i386 subversion patch wget cmake make libtool curl libc6-dev-i386 -y

参考:https://cwiki.apache.org/confluence/display/HADOOP2/HowToSetupUbuntuBuildMachine

cmake的版本要求至少在3.1以上,如果yum安装的版本低于3.1,则手动下载安装:
https://cmake.org/download/
在这里插入图片描述


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值