在CentOS 7上从源码上构建Ambari 2.7.5,2周前还能用,现在失败了。

问题描述 投票:0回答:1

按照这里的说明进行安装。Ambari 2.7.5在CentOS 7上的安装失败。

我按照完全相同的说明,现在从ambari-admin部分的构建中得到了这个。

[INFO] --- exec-maven-plugin:1.2.1:exec (Bower install) @ ambari-admin ---
bower angular-route#*           
bower angular-route#*         
bower underscore#1.7.0        
bower underscore#1.7.0        
bower bootstrap#3.3.7         
bower bootstrap#3.3.7         
bower angular-mocks#*         
bower angular-mocks#*         
bower angular#*               
bower angular#*               
bower font-awesome#4.2.0      
bower font-awesome#4.2.0      
bower angular-translate#*     
bower angular-translate#*     
bower chai#1.8.0              
bower chai#1.8.0              
bower mocha#1.14.0            
bower mocha#1.14.0            
bower angular-animate#*       
bower angular-animate#*       
bower angular-bootstrap-toggle-switch#0.5.1         
bower angular-bootstrap-toggle-switch#0.5.1         
bower restangular#1.4.0                             
bower restangular#1.4.0                             
bower commonjs#0.2.0                                
bower commonjs#0.2.0                                
bower sinon#1.10.3                                  
bower sinon#1.10.3                                  
bower angular-bootstrap#0.11.0                      
bower angular-bootstrap#0.11.0                      
bower angular#>=1.2.26 <1.8                         
bower angular#>=1.2.26 <1.8                         
bower lodash#>=1.3.0 <2.5.0                         
bower lodash#>=1.3.0 <2.5.0                         
bower angular#>=1                                   
bower angular#>=1                                   
bower jquery#1.9.1 - 3                              
bower jquery#1.9.1 - 3                              
bower ECONFLICT Unable to find suitable version for angular    

如果有必要,我可以提供整个堆栈。

我的问题是 1. 为什么2周前构建的项目,在完全没有变化的情况下,现在用上述堆栈失败了? 2. 该如何解决这个问题?

真的很感谢任何意见或帮助。

按照要求,以下是我遵循的步骤。

1. Using lxc to create centOS 7 x86_64 environment:
     lxc launch images:centos/7/amd64 cent7

2. Attach to that kernal, this logs you in as root in a bash shell
     lxc exec cent7 bash

3. Install necessary packages
    yum install -y which
    yum install -y wget
    yum install -y rpm-build*
    yum install -y gcc*
    yum install -y git*
    yum install -y python-devel*
    yum install -y maven 
       (This installs an old version,3.0.5, but takes care of all dependencies such as java)

    Get latest version of maven, Ambari build needs at least 3.3.9
      mkdir /maven363 ; cd /maven363
      wget http://mirror.cogentco.com/pub/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
      tar zxf apache-maven-3.6.3-bin.tar.gz
      ## Setup paths to this maven in .bashrc file
      vi ~/.bashrc
        export PATH=/maven363/apache-maven-3.6.3/bin:$PATH
        export _JAVA_OPTIONS="-Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"
      ## Instantiate the above .bashrc changes
         . ~/.bashrc

    Get python tools for python 2.7
        mkdir /PythonTools ; cd /PythonTools/
        wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea

        sh setuptools-0.6c11-py2.7.egg

4. Get the Ambari source code
       mkdir /Ambari275 ; cd /Ambari275
       wget https://www-eu.apache.org/dist/ambari/ambari-2.7.5/apache-ambari-2.7.5-src.tar.gz

5. Untar the file
    tar zxf apache-ambari-2.7.5-src.tar.gz 

6. Fix the ambari-admin pom.xml file to load the correct versions of npm and node.js (This module had compilation errors),
   Found fix information here:
      https://stackoverflow.com/questions/61542102/ambari-2-7-5-installation-failure-on-centos-7

   cd /Ambari275/apache-ambari-2.7.5-src/ambari-admin
   vi pom.xml

     From:
         <nodeVersion>v4.5.0</nodeVersion>
         <npmVersion>2.15.0</npmVersion>
     To:
        <nodeVersion>v6.17.1</nodeVersion>
        <npmVersion>3.10.10</npmVersion>

7. Now follow all instructions here:
    https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.7.5
ambari
1个回答
0
投票

Q1:你的编译环境一定发生了变化。 无论是哪种情况,如果构建环境中的版本不理想,整个项目中更深层次的依赖关系就会产生冲突。

Q2:你要找的解决方案是修改以下文件。

nano ambari-admin/src/main/resources/ui/admin-web/bower.json

内容应该是:

{
  "name": "adminconsole",
  "private": true,
  "dependencies": {
    "bootstrap": "3.3.7",
    "angular": "1.3.0",
    "angular-route": "1.3.0",
    "angular-bootstrap": "0.11.0",
    "underscore": "1.7.0",
    "restangular": "1.4.0",
    "angular-bootstrap-toggle-switch": "0.5.1",
    "angular-animate": "1.3.0",
    "angular-translate": "~2.8.1",
    "font-awesome": "4.2.0"
  },
  "devDependencies": {
    "angular-mocks": "1.3.0",
    "commonjs": "0.2.0",
    "chai": "1.8.0",
    "mocha": "1.14.0",
    "sinon": "1.10.3"
  }
}

而构建环境中的版本如下。

npm -v
    6.14.4
node -v
    v10.21.0
python -V
    Python 2.7.18
mvn -v
    Apache Maven 3.6.3 

你可能需要玩玩Angular的版本。 我在上面发布的片段是我今天在不同的操作系统(SUSE openSUSE)中工作的片段。 我在centos中没有得到这个错误。 我已经撰写并参与了一些最近的SO线程,所以从源头上对Ambari 2.7.5有了很深的了解。

© www.soinside.com 2019 - 2024. All rights reserved.