TT Bigdata TT Bigdata
首页
GitHub (opens new window)
JaneTTR

JaneTTR

数据酿造智慧,每一滴都是沉淀!
  • 报错解决

    • Ambari 报错
      • Ambari Views

      • Ambari

        • phantomjs下载失败问题
        • 编译问题:GCC 安装与配置
          • 一、在 Ambari 项目中编译 ambari-web 时的 GCC 版本问题
            • 1.1 编译时报错日志
            • 1.2 解决方案
            • 1.2.1 使用多版本 GCC 共存
            • 1.2.2 配置示例
        • bower CERT_HAS_EXPIRED 错误问题
        • Ambari-admin包出现bower install错误
        • Cannot run program "rpmbuild"
        • Python: No such file or directory
        • Yarn解压报错EOFException排查与解决
        • Rpm-maven-plugin与shebang兼容性报错
        • Rpm-maven-plugin 最佳实践
        • Bower install拉取失败解决
        • 缺少 python3 报错解决
        • Python(>=2.6) but is not installed
        • SSL_ERROR_SYSCALL 的修复方法
      • Ambari-infra

      • Ambari-metrics

    • Bigtop 报错
  • 系统适配

  • 监控与调优

  • BUG临时处理
  • 实验室

  • 运维资料
  • 报错解决
  • Ambari 报错
  • Ambari
JaneTTR
2023-04-05
目录
一、在 Ambari 项目中编译 ambari-web 时的 GCC 版本问题
1.1 编译时报错日志
1.2 解决方案
1.2.1 使用多版本 GCC 共存
1.2.2 配置示例

编译问题:GCC 安装与配置

# 一、在 Ambari 项目中编译 ambari-web 时的 GCC 版本问题

# 1.1 编译时报错日志

在编译 ambari-web 时,如果遇到如下报错,通常是因为系统中 GCC 版本较低,无法满足 Node.js 的依赖需求:

[DEBUG] Loading mojo com.github.eirslett:frontend-maven-plugin:1.4:yarn from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.4, parent: sun.misc.Launcher$AppClassLoader@7852e922]
[DEBUG] Configuring mojo execution 'com.github.eirslett:frontend-maven-plugin:1.4:yarn:yarn install' with basic configurator -->
[DEBUG]   (f) arguments = install --ignore-engines --pure-lockfile --verbose
[DEBUG]   (f) environmentVariables = {npm_config_tmp=/tmp/npm_config_tmp}
[DEBUG]   (f) npmRegistryURL = https://registry.npmmirror.com
[DEBUG]   (f) project = MavenProject: org.apache.ambari:ambari-web:2.8.0.0.0 @ /opt/modules/ambari/ambari-web/pom.xml
[DEBUG]   (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@3c35c345
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@41aaedaa
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipTests = false
[DEBUG]   (f) testFailureIgnore = false
[DEBUG]   (f) workingDirectory = /opt/modules/ambari/ambari-web
[DEBUG]   (f) yarnInheritsProxyConfigFromMaven = false
[DEBUG]   (f) execution = com.github.eirslett:frontend-maven-plugin:1.4:yarn {execution: yarn install}
[DEBUG] -- end configuration --
[INFO] yarn not inheriting proxy config from Maven
[INFO] Running 'yarn install --ignore-engines --pure-lockfile --verbose --registry=https://registry.npmmirror.com/' in /opt/modules/ambari/ambari-web
[DEBUG] Executing command line [/opt/modules/ambari/ambari-web/node/yarn/dist/bin/yarn, install, --ignore-engines, --pure-lockfile, --verbose, --registry=https://registry.npmmirror.com]
[ERROR] node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
[ERROR] node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
[ERROR] node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
[ERROR] node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
[ERROR] node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
[ERROR] node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.140 s
[INFO] Finished at: 2024-08-20T09:15:00+08:00
[INFO] ------------------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

这类问题通常与系统中的 GCC 版本过低有关,导致 Node.js 的依赖无法满足。

# 1.2 解决方案

# 1.2.1 使用多版本 GCC 共存

为了解决编译时因 GCC 版本过低导致的报错,我们可以启用 SCL(Software Collection)源来安装更高版本的 GCC。你可以通过以下步骤来实现:

  1. 启用 devtoolset-7(包含较新的 GCC 版本):

    scl enable devtoolset-7 bash
    
    1
  2. 安装 devtoolset-7-gcc 和 devtoolset-7-gcc-c++:

    yum install devtoolset-7-gcc devtoolset-7-gcc-c++
    
    1

通过这种方式,你可以在当前系统中使用较新的 GCC 版本,而不需要替换掉系统自带的低版本 GCC。

GCC 安装与配置示意图

提示

启用 SCL 后,系统会使用 devtoolset-7 提供的 GCC,而不会影响系统中其他工具的正常使用。这使得多版本共存成为可能,解决了版本兼容问题。

# 1.2.2 配置示例

  1. 配置 YUM 仓库并启用对应版本的 GCC,确保安装最新版的编译工具链。

  2. 在项目中配置好相应的编译环境后,执行以下命令:

    scl enable devtoolset-7 bash
    
    1

注意

确保你在执行命令时已经正确配置了 SCL 环境,否则可能无法正确启用高版本 GCC。

通过这些步骤,你可以解决由于 GCC 版本过低引起的编译问题,并成功编译项目。

本文提供的解决方案适用于需要使用新版 GCC 的系统,实际操作中可能会根据系统环境有所不同。如果遇到问题,欢迎留言讨论。贡献

#Ambari#错误排查#版本适配
phantomjs下载失败问题
bower CERT_HAS_EXPIRED 错误问题

← phantomjs下载失败问题 bower CERT_HAS_EXPIRED 错误问题→

最近更新
01
当前版本 2026/08
08-29
02
把 Ambari Server HA 稳稳地跑起来
08-17
03
从一次启用操作追到主备就绪
08-17
更多文章>
Theme by Vdoing | Copyright © 2017-2026 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式